【发布时间】:2022-11-04 19:48:24
【问题描述】:
我昨天创建了构建,它工作正常。但是当我今天尝试创建发布版本时,我得到了这个。一些如果这里已经问过的问题
这些问题是 android 特有的,react-native 的新用户不容易理解它们。所以这就是为什么我在这里问另一个专门针对 react-native 用户的问题。
我上面提到的问题的答案在某些特定情况下会有所帮助,但是在某些情况下反应原生时它没有帮助,例如 node_modules 中的某些依赖项。
添加上述解释是因为问题被标记为重复。
构建将继续,但强烈建议您将项目更新为 使用经过 compileSdk = 33 测试的更新的 Android Gradle 插件
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-community_masked-view:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-community_masked-view:releaseRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-community_masked-view
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 45s
5 actionable tasks: 5 up-to-date
我认为这个问题是由于 jcenter deprecation 造成的。 jcenter 的任何可能的解决方案或替代方案。这适用于有许多依赖项并且您必须更改的 react-native 项目。
【问题讨论】:
-
一个可能的答案也可能是this answer。
标签: react-native android-studio jcenter