Bad gateway when building Android React Native
Asked Answered
C

5

5

When I run react-native run-android, I get the following error:

* 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

I have seen similar issues others were having and they said to check the status: https://status.bintray.com/ - but it's saying everything is operational. I also grepped my whole codebase for bintray, but there is no reference to it.

Edit: Also tried that URL in the browser and get the same 502

also:

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>

Update It seems that bintray was "sunsetted" so I'm not expecting it to come back. I've replaced jcenter() with mavenCentral() and it seemed to help, but I still get errors like the following:

* 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

I tried to exclude yoga and others in the build file but it doesn't work. I have no idea what to do.

Cleocleobulus answered 30/11, 2021 at 20:34 Comment(2)
is your issue resolved ? getting this issue suddenly, till yesterday it was working fineMarashio
No, although it's giving me a 403 now instead of a 503Cleocleobulus
C
1

It works now.

I reset my hours of changes to master and it works. Leaving this here for future people who have this error - don't trust the bintray status page, just wait. I read somewhere during my research that it will stay up indefinitely read only.

Cleocleobulus answered 1/12, 2021 at 16:46 Comment(5)
Update - it's happening again. I got around it this time by going offline so it relied on the cache. It didn't work last time presumably because I cleared my cacheCleocleobulus
I can approve that its happening again. It's so sad that we can't follow any updates to check when will it be resolved. It is best to update to alternative solutions as soon as possible.Exacerbate
Same problem. dl.bintray.com/microsoftazuremobile/SDK/com/facebook/react/… -- getting 502 error.Repose
status.jfrog.io Looks like the bintray already get the report of this error and working on fix.Repose
I ran ./gradlew assembleRelease --offline if it helpsCleocleobulus
N
3

I wouldn't recommend depending on JCenter, it has been unstable these past few weeks.

There's an official library from Intercom for React-Native now! It's using the new mavenCentral repo, and there's very little differences (that I found) between this and react-native-intercom. The methods are the same. You might want to migrate to it.

Nephritis answered 1/12, 2021 at 16:53 Comment(5)
Oh nice! There are other libraries I rely on that use JCenter unfortunately so I think I will have to keep using it for now. I didn't know about that lib though!! Thanks!!Cleocleobulus
In the same boat! No choice but to wait for RN libraries to update their dependencies. (Or maybe we can force it?)Nephritis
Changing to that official library works for me! Thanks @NishantNairUnskillful
At least, there is a non-migrated method. In the previous library exists: Intercom.presentCarousel. And in the new library the same method has a different name: Intercom.displayCarouselUnskillful
One more deprecated: displayConversationsListUnskillful
C
1

It works now.

I reset my hours of changes to master and it works. Leaving this here for future people who have this error - don't trust the bintray status page, just wait. I read somewhere during my research that it will stay up indefinitely read only.

Cleocleobulus answered 1/12, 2021 at 16:46 Comment(5)
Update - it's happening again. I got around it this time by going offline so it relied on the cache. It didn't work last time presumably because I cleared my cacheCleocleobulus
I can approve that its happening again. It's so sad that we can't follow any updates to check when will it be resolved. It is best to update to alternative solutions as soon as possible.Exacerbate
Same problem. dl.bintray.com/microsoftazuremobile/SDK/com/facebook/react/… -- getting 502 error.Repose
status.jfrog.io Looks like the bintray already get the report of this error and working on fix.Repose
I ran ./gradlew assembleRelease --offline if it helpsCleocleobulus
P
1

I'm having this issue now that jcenter has sunset what seems like 2 months early. https://status.bintray.com/

Help to resolve this would be great. Adding mavenCentral() has not helped, upgrading gradle to v6.9 & React Native versions to 0.65.0. has not helped either.

I still get the error:

> 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
Pontiff answered 13/12, 2021 at 12:48 Comment(0)
H
1

I using new maven, it woking for me

File :

./android/build.gradle

changer to:

maven { url 'https://repo1.maven.org/maven2/' }
Honestly answered 4/3, 2022 at 8:58 Comment(0)
A
0

Toggle Offline Mode Button

  1. Swtich On Toggle Offline Mode(check the above image link!) in Gradle Window
  • You can open Gradle Window by clicking Gradle button in the right side bar.
  1. Build > Clean Project and File > Invalidate Caches > (check) Clear file system cache and Local History > Invalidate and Restart
  2. File > Sync Project with Gradle Files

It works after these things.

Arethaarethusa answered 25/3, 2022 at 1:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.