當運行yarn android出現錯誤時,我使用 react native 66
yarn run v1.22.17 $ react-native run-android info 運行 jetifier 將庫遷移到 AndroidX。您可以使用“--no-jetifier”標志禁用它。Jetifier 找到了 1428 個要轉發 Jetify 的檔案。使用 4 個工人...資訊 JS 服務器已經在運行。info 安裝應用程式...配置專案:react-native-firebase react-native-firebase:使用來自 /Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/react-native/android 的 React Native 預構建二進制檔案 警告::指定的 Android SDK 構建工具版本 (28.0.3) 將被忽略,因為它低于 Android Gradle 插件 4.2.2 的最低支持版本 (30.0.2)。將使用 Android SDK Build Tools 30.0.2。要取消此警告,請從 build.gradle 檔案中洗掉“buildToolsVersion '28.0.3'”,因為每個版本的 Android Gradle 插件現在都有一個默認版本的構建工具。任務 :app:checkDebugAarMetadata FAILED 此版本中使用了已棄用的 Gradle 功能,使其與 Gradle 7.0 不兼容。使用“--warning-mode all”來顯示單個棄用警告。看https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings 39 個可操作任務:2 個已執行,37 個最新失敗:構建失敗,出現例外。出了什么問題:任務“:app:checkDebugAarMetadata”的執行失敗。無法決議配置“:app:debugRuntimeClasspath”的所有檔案。找不到 com.android.volley:volley:1.1.1。在以下位置搜索: - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom - 檔案:/Users/ha3an/.m2/repository/com/android/volley/volley/1.1.1/volley-1.1.1.pom - 檔案:/Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/ react-native/android/com/android/volley/volley/1.1.1/volley-1.1.1.pom - 檔案:/Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/jsc-android/dist/com /android/volley/volley/1.1.1/volley-1.1.1.pom - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1 .1.pom - https://www.jitpack.io/com/android/volley/volley/1.1.1/volley-1.1.1.pom 需要:專案 :app > 專案 :react-native-google-places > com.google.android.libraries.places:places:1.1.0 嘗試:使用 --stacktrace 選項運行以獲取堆疊跟蹤。使用 --info 或 --debug 選項運行以獲得更多日志輸出。使用 --scan 運行以獲得完整的見解。在https://help.gradle.org獲得更多幫助 BUILD FAILED in 25s
和 build.qradle 檔案是
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("com.google.gms:google-services:4.3.10")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
我嘗試在我的 build.gradle 檔案上使用 jcenter 它已成功構建但出現錯誤
Error: ENOENT: no such file or directory, open '/.../phone/homeserviceuser/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.aloosalamati.homeserviceuser&modulesOnly=false&runModule=true'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at getCodeFrame (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:919:18)
at Server._symbolicate (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:992:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Server._processRequest (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:403:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/.../phone/homeserviceuser/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.aloosalamati.homeserviceuser&modulesOnly=false&runModule=true'
}
我用谷歌搜索但找不到任何解決方案
uj5u.com熱心網友回復:
我使用jcenter,它作業正常
uj5u.com熱心網友回復:
你可以在你的 gradel.build 檔案中添加 jcenter 我認為它的作業
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/367801.html
上一篇:構建flutterApk時發生
