React Native -- 无法确定任务 ':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/

相关内容

  • 没有找到相关文章

最新更新