我正在尝试为 Android 构建我的 React-Native 项目,并在 Windows 上收到以下错误,但它在 Mac 上工作。
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1090 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
> Task :react-native-get-sms-android:generateDebugRFile FAILED
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.9/userguide/command_line_interface.html#sec:command_line_warnings
128 actionable tasks: 128 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-get-sms-android:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-get-sms-android:debugCompileClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-get-sms-android
> 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'. Received status code 502 from server: Bad Gateway
* 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 24s
我的环境:
- Windows 10 家庭版
- 反应本机 v66.4
- NodeJS v12.18.1
当用谷歌搜索有关 bintray 已关闭的错误并且可以在以下位置跟踪其状态时找到了解决方案https://status.bintray.com https://status.bintray.com.
但建设项目Mac环境下运行良好,同时,它是在 Windows 中失败 with Received status code 502 from server: Bad Gateway
。关于这种奇怪行为的任何线索吗?
如果 Osvaldo 的解决方案不起作用,另一种方法是更新依赖项本身,该依赖项本身依赖于当前版本的 gradle 中的 jcenter。
在这种情况下,它是react-native-get-sms-android
。更新它可能会将其从 jcenter 中释放。
就我而言,它是旧版本react-native-sqlite-2
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)