构建 Android React Native 时的错误网关

问题描述 投票:0回答:6

当我运行

react-native run-android
时,出现以下错误:

* What went wrong:
Could not determine the dependencies of task ':react-native-intercom:generateDebugRFile'.
> Could not resolve all task dependencies for configuration ':react-native-intercom:debugRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-intercom
      > Failed to list versions for com.facebook.react:react-native.
         > Unable to load Maven meta-data from https://dl.bintray.com/intercom/intercom-maven/com/facebook/react/react-native/maven-metadata.xml.
            > Could not get resource 'https://dl.bintray.com/intercom/intercom-maven/com/facebook/react/react-native/maven-metadata.xml'.
               > Could not GET 'https://dl.bintray.com/intercom/intercom-maven/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

我见过其他人遇到的类似问题,他们说要检查状态:https://status.bintray.com/ - 但它说一切都可以运行。我还对 bintray 的整个代码库进行了 grep,但没有引用它。

编辑: 还在浏览器中尝试了该 URL 并得到相同的 502

还有:

dara@dara-beast:~/DAD/rn-app$ curl http://dl.bintray.com/intercom/intercom-maven/com/facebook/react/react-native/maven-metadata.xml
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>


dara@dara-beast:~/DAD/rn-app$ curl https://dl.bintray.com/
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

更新 看来 bintray 已经“日落”了,所以我不指望它会回来。我已将

jcenter()
替换为
mavenCentral()
,它似乎有所帮助,但我仍然收到如下错误:

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
     Searched in the following locations:
       - file:/home/dara/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - file:/home/dara/DAD/rn-app/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - file:/home/dara/DAD/rn-app/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - https://maven.google.com/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
       - https://sdk.squareup.com/public/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
     Required by:
         project :app > com.facebook.react:react-native:0.63.4
   > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
     Searched in the following locations:
       - file:/home/dara/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - file:/home/dara/DAD/rn-app/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - file:/home/dara/DAD/rn-app/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - https://maven.google.com/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
       - https://sdk.squareup.com/public/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
     Required by:
         project :app > com.facebook.react:react-native:0.63.4

我尝试在构建文件中排除瑜伽和其他内容,但它不起作用。我不知道该怎么办。

android react-native bintray
6个回答
3
投票

我不建议依赖JCenter,过去几周它一直不稳定。

Intercom 现在有一个用于 React-Native 的官方库!它使用新的

mavenCentral
存储库,并且(我发现)它与
react-native-intercom
之间几乎没有差异。方法是一样的。您可能想迁移到它。


1
投票

现在可以使用了。

我将更改的时间重新设置为掌握,并且它有效。将此错误留在这里供将来遇到此错误的人使用 - 不要相信 bintray 状态页面,只需等待。我在研究过程中读到过它会无限期地保持只读状态。


1
投票

我现在遇到了这个问题,因为 jcenter 已经提前 2 个月关闭了。 https://status.bintray.com/

帮助解决这个问题就太好了。添加 mavenCentral() 没有帮助,将 gradle 升级到 v6.9 并将 React Native 版本升级到 0.65.0。也没有帮助。

我仍然收到错误:

> Failed to list versions for com.facebook.react:react-native.
     > Unable to load Maven meta-data from https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml.
        > Could not get resource 'https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml'.
           > Could not GET 'https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

1
投票

我使用新的maven,它对我有用

文件:

./android/build.gradle

更改为:

maven { url 'https://repo1.maven.org/maven2/' }

0
投票

Toggle Offline Mode Button

  1. 在 Gradle 窗口中打开
    Toggle Offline Mode
    (检查上面的图片链接!)
    您可以通过单击右侧栏中的 Gradle 按钮来打开 Gradle 窗口。
  1. Build > Clean Project
    File > Invalidate Caches > (check) Clear file system cache and Local History > Invalidate and Restart
    
    
  2. File > Sync Project with Gradle Files
    
    
这些事情之后就可以了。


0
投票
可能是 JCenter 全球中断(这种情况时有发生)。

您可以在这里

监控状态

© www.soinside.com 2019 - 2024. All rights reserved.