簡體   English   中英

React Native——無法確定任務“:app:mergeDebugAssets”的依賴關系

[英]React Native -- Could not determine the dependencies of task ':app:mergeDebugAssets'

我正在嘗試使用npm run android命令運行我的項目,它會為我拋出此錯誤:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1579 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Installing the app...
Configuration on demand is an incubating feature.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> You must specify a URL for a Maven repository.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

到目前為止我所做的是cd到 android 文件夾並運行./gradlew clean並且它說BUILD SUCCESSFUL沒有錯誤我也刪除了我的node_module文件夾並再次運行npm install但沒有運氣。 我感謝任何幫助。

我有一個類似的錯誤,在我的例子中,我像這樣編輯了我的android/build.gradle文件:

...
jcenter()

添加行

mavenCentral()

不知道對你的情況是否有幫助,但對我有用

PS 據我了解,在https://jcenter.bintray.com/訪問某些文件存在一些問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM