question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

502 Bad Gateway: Unable to load Maven meta-data from Bintray

See original GitHub issue

Description

Getting such an error, while building the app in release mode:

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

build.gradle

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        supportLibVersion = "28.0.0"
        googlePlayServicesVersion = "11.0.0"
        googlePlayServicesLocationVersion = "17.0.0"
        appCompatVersion = "1.1.0"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.1")
        classpath("com.google.gms:google-services:4.3.10")
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven { url("$rootDir/../node_modules/react-native/android") }
        maven { url("$rootDir/../node_modules/jsc-android/dist") }
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url "https://repo.spring.io/plugins-release/" }
        google()
        maven { url 'https://www.jitpack.io' }
        flatDir {
            dirs "$rootProject.projectDir/libs"
        }

        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }

        maven {
            url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
            credentials {
                username 'braintree_team_sdk'
                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
            }
        }
    }
}

The problem appeared without any code changes. Bintray status is major outage: https://isdown.app/integrations/bintray

Please advise, which steps do I need to perform, so I can successfully create release builds.

Version

0.65.0

Output of react-native info

System:
    OS: macOS 12.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 114.16 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: Not Found
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2021.11.15.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
      System Images: android-31 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7784292
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.65.0 => 0.65.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

./gradlew assembleRelease

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
ShikaSDcommented, Jan 14, 2022

In case you are debugging similar error for your app (bintray is down again), and upgrading to 0.65+ is not an option for some reason, you can try and force dependencies manually:

  • Replace all usages of jcenter() with mavenCentral().
  • In case an old version of some dependency is not on mavenCentral, add a new block in your build.gradle, forcing newer versions of dependencies. You can find which dependencies are available in what repository with this search. Here’s the example for dependencies unavailable in 0.64.3:
allprojects {
    repositories {
        ...
        mavenCentral()

        configurations.all {
            resolutionStrategy {

                // versions used by 0.67
                force 'com.squareup.okhttp3:okhttp:3.11.0'
                force 'com.facebook.yoga:proguard-annotations:1.19.0'
                force 'com.facebook.fbjni:fbjni-java-only:0.2.2'
                force 'com.facebook.flipper:flipper:0.99.0'
                force 'com.facebook.flipper:flipper-network-plugin:0.99.0'
                force 'com.facebook.flipper:flipper-fresco-plugin:0.99.0'
            }
        }

    }
}
10reactions
areebshakeelcommented, May 10, 2022

In case you are debugging similar error for your app (bintray is down again), and upgrading to 0.65+ is not an option for some reason, you can try and force dependencies manually:

  • Replace all usages of jcenter() with mavenCentral().
  • In case an old version of some dependency is not on mavenCentral, add a new block in your build.gradle, forcing newer versions of dependencies. You can find which dependencies are available in what repository with this search. Here’s the example for dependencies unavailable in 0.64.3:
allprojects {
    repositories {
        ...
        mavenCentral()

        configurations.all {
            resolutionStrategy {

                // versions used by 0.67
                force 'com.squareup.okhttp3:okhttp:3.11.0'
                force 'com.facebook.yoga:proguard-annotations:1.19.0'
                force 'com.facebook.fbjni:fbjni-java-only:0.2.2'
                force 'com.facebook.flipper:flipper:0.99.0'
                force 'com.facebook.flipper:flipper-network-plugin:0.99.0'
                force 'com.facebook.flipper:flipper-fresco-plugin:0.99.0'
            }
        }

    }
}

i just added mavenCentral() with jcenter() and it worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not GET 'play-services-location/maven-metadata.xml ...
Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway · It seems to be working now, is it ...
Read more >
Unable to load Maven meta-data from. Received status code ...
In this video you will the solution for given below error. · Could not GET ' · Received status code 502 from server:...
Read more >
Expo - Android Classic Builds failing due to missing Maven ...
[stderr] > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/facebook/react ... Received status code 502 from server: Bad Gateway ...
Read more >
HTTP 502 when fetching artifacts from jcenter.bintray.com
Running wget https://jcenter.bintray.com/ in a CircleCI container (circleci@5b9c2538ca80) gives a 502 (Bad Gateway), but the same command ...
Read more >
Android jcenter bad gateway 502(Unable to load Maven ...
Android jcenter bad gateway 502(Unable to load Maven meta-data from https://jcenter.bintray.com)_肖波86440的博客-程序员宅基地. 技术标签: gradle bad ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found