无法 HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'。从服务器收到状态代码 502:网关错误

Sur*_*off 5 android maven bintray jcenter react-native

我正在尝试为 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
Run Code Online (Sandbox Code Playgroud)

我的环境:

  • Windows 10 家庭版
  • 反应本机 v66.4
  • NodeJS v12.18.1

当用谷歌搜索有关 bintray 已关闭的错误时找到了解决方案,并且可以在https://status.bintray.com跟踪其状态。

但是构建该项目在 Mac 环境下运行良好,同时在 Windows 环境下运行失败Received status code 502 from server: Bad Gateway。关于这种奇怪行为的任何线索吗?

Yai*_*pro 0

如果 Osvaldo 的解决方案不起作用,另一种解决方案是更新依赖项本身,该依赖项本身依赖于当前版本的 gradle 中的 jcenter。

在这种情况下,它是react-native-get-sms-android. 更新它可能会将其从 jcenter 中释放。

就我而言,它是旧版本的react-native-sqlite-2.