Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
latusdenis opened this issue Dec 10, 2021 · 19 comments
Closed

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

latusdenis opened this issue Dec 10, 2021 · 19 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@latusdenis
Copy link

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

@markhomoki
Copy link

Has anyone found a solution to this?

@sonydaman
Copy link

Not yet,I am also facing same issue.
`

  • What went wrong:
    Could not determine the dependencies of task ':app:processDebugResources'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
project :app > project :react-native-simple-splash-screen
project :app > project :react-native-push-notification
project :app > project :@react-native-community_cameraroll
project :app > project :react-native-async-storage_async-storage
project :app > project :react-native-clipboard_clipboard
project :app > project :react-native-community_cameraroll
project :app > project :react-native-community_viewpager
project :app > project :react-native-picker_picker
project :app > project :react-native-camera
project :app > project :react-native-device-info
project :app > project :react-native-document-picker
project :app > project :react-native-fast-image
project :app > project :react-native-file-viewer
project :app > project :react-native-fs
project :app > project :react-native-gesture-handler
project :app > project :react-native-i18n
project :app > project :react-native-reanimated
project :app > project :react-native-screens
project :app > project :react-native-share
project :app > project :react-native-svg
project :app > project :react-native-vector-icons
project :app > project :react-native-webview
project :app > project :rn-fetch-blob
> 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
Could not resolve com.squareup.okhttp3:okhttp:3.9.1.
Required by:
project :app > project :react-native-fast-image > com.github.bumptech.glide:okhttp3-integration:4.12.0
> Skipped due to earlier error
`

@markhomoki
Copy link

I found a solution that worked for us.

I replaced all the instances where it shows + in the implementation with the actual version.

If you run ./gradlew app:dependencies in the android folder, it will display which version is being used in the project. So after running the command you can do the following:

  1. If the + happens internally, then just replace it with the actual version
  2. If the + happens in a dependency, you can use resolutionStrategy in android/build.gradle such as:
allprojects {
  repositories {
    mavenLocal()
    google()
    mavenCentral()
    .... other repos

    configurations.all {
      resolutionStrategy {
        force 'com.squareup.okhttp3:okhttp:3.11.0'
        force 'com.facebook.react:react-native:0.66.1'
        force 'com.facebook.android:facebook-android-sdk:8.2.0'
      }
    }
  }
}

Also, because jscFlavor was using +, I had to add this in android/app/build.gradle:
def jscFlavor = 'org.webkit:android-jsc:r250230'

Hopefully, once react-native is on mavenCentral, we can remove the version lock.

@cortinico
Copy link
Contributor

As mentioned, this is happening as you have https://cardinalcommerce.bintray.com/ declared in your repositories{} block. You should ideally remove jcenter() and all the bintray.com repos from there.

There is currently an outage that is affecting those builds. So potentially as this is resolved, your builds will also get back green.

Hopefully, once react-native is on mavenCentral, we can remove the version lock.

We're not looking into publishing RN on mavenCentral anytime soon. RN is distributed as a NPM package and you don't need any Maven repo to look into. The package is available inside the node_modules folder on your machine.

@brentvatne
Copy link
Collaborator

@cortinico - would it be possible to publish older versions of related packages to maven central? the following dependency versions are missing from maven central and so react-native@64 apps won't build if jcenter is unavailable:

com.facebook.yoga:proguard-annotations:1.14.1
com.facebook.fbjni:fbjni-java-only:0.0.3
com.facebook.flipper:flipper:0.54.0
com.facebook.flipper:flipper-network-plugin:0.54.0
com.facebook.flipper:flipper-fresco-plugin:0.54.0

it appears that any dependency on jcenter was resolved in 65+ however.

@fazzysyed
Copy link

i was working on the app and it was working fine but suddenly i am getting this and unable to build my app

  > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.pom'. Received status code 502 from server: Bad Gateway

@cortinico
Copy link
Contributor

@cortinico - would it be possible to publish older versions of related packages to maven central? the following dependency versions are missing from maven central and so react-native@64 apps won't build if jcenter is unavailable:

That's doable. You should open specific issues for each package on its own issue board:
https://github.com/facebookincubator/fbjni/issues
https://github.com/facebook/flipper/issues
https://github.com/facebook/yoga/issues

However, please note that it will take some time for those maintainers to get back to you and potentially re-release those older packages. The best would be for you to bump them locally.

@FelipeLimaDeSouza
Copy link

FelipeLimaDeSouza commented Jan 12, 2022

Gradle is down
https://status.gradle.com/

@sonydaman
Copy link

Any idea when it will up.

@brentvatne
Copy link
Collaborator

@cortinico - if I'm not mistaken, you are a Meta employee -- would you be able to reach out to those teams to ask them to follow up on this? there are existing issues on those repositories already that are ~6 months old:

facebookincubator/fbjni#65
facebook/yoga#1065

@sonydaman
Copy link

It's up and for me it's working. :)

@cortinico
Copy link
Contributor

I've posted a small update on what happened here: react-native-community/discussions-and-proposals#331 (comment)

Closing as this is essentially resolved as the bintray outage is finished

@cortinico - if I'm not mistaken, you are a Meta employee -- would you be able to reach out to those teams to ask them to follow up on this? there are existing issues on those repositories already that are ~6 months old:

We can definitely look into publishing older version to Maven Central. However, I believe that updating the RN version you're using (either directly or through Expo) is in general a better approach as we're trying to encourage people to migrate rather than being stuck on an older version.

@ShikaSD
Copy link
Contributor

ShikaSD commented 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'
            }
        }

    }
}

@ezze
Copy link

ezze commented Jan 17, 2022

@ShikaSD Thanks for solution but it doesn't work for me unfortunately. Forcing okhttp breaks react-native-blob-courier in my case:

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: /home/ezze/Development/geo-front/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/ezze/Development/geo-front/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (29, 13): Unresolved reference: buffer
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (30, 13): Unresolved reference: sink
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (74, 16): Cannot access 'body': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (75, 28): Unresolved reference: sink
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (89, 34): Cannot access 'code': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (90, 53): Cannot access 'headers': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/fetch/UnmanagedDownloader.kt: (113, 29): Cannot access 'body': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/progress/BlobCourierProgressRequest.kt: (16, 13): Unresolved reference: buffer
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/progress/BlobCourierProgressRequest.kt: (30, 24): Unresolved reference: buffer
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/progress/BlobCourierProgressResponse.kt: (13, 13): Unresolved reference: buffer
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/progress/BlobCourierProgressResponse.kt: (27, 69): Unresolved reference: buffer
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/BlobUploader.kt: (62, 35): Cannot access 'body': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/BlobUploader.kt: (69, 32): Cannot access 'code': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/BlobUploader.kt: (71, 51): Cannot access 'headers': it is package-private in 'Response'
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/InputStreamRequestBody.kt: (15, 13): Unresolved reference: source
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/InputStreamRequestBody.kt: (37, 35): Unresolved reference: source
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/UploaderParameterFactory.kt: (51, 26): Unresolved reference: Companion
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/UploaderParameterFactory.kt: (52, 26): Unresolved reference: Companion
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/UploaderParameterFactory.kt: (87, 34): Unresolved reference: toMediaTypeOrNull
e: /home/ezze/Development/geo-front/mobile/node_modules/react-native-blob-courier/android/src/main/java/io/deckers/blob_courier/upload/UploaderParameterFactory.kt: (88, 40): Unresolved reference: toMediaType

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-blob-courier:compileDebugKotlin'.

@ShikaSD
Copy link
Contributor

ShikaSD commented Jan 17, 2022

@ezze Could you try forcing version of okhttp to one of the 4+ instead?

@areebshakeel
Copy link

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

@cristiandan
Copy link

worked for me by adding mavenCentral() call right before each jcenter()

@Jefferson-Bueno-Da-Silva

worked for me replacing jcenter() to mavenCentral()

@luck2011
Copy link

@areebshakeel @cristiandan You made my day, bro!

@facebook facebook locked as resolved and limited conversation to collaborators May 19, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests