I've been having this issue since about 9 Dec. It seems jcenter has sunset 2 months early (https://status.bintray.com/)
I've updated my RN version to 0.65.0, my Gradle to v6.9 and I've added mavenCentral() in place of jcenter(). Building in offline mode does not work and is not a permanent solution.
This happens during build cd android && ./gradlew clean && ./gradlew bundleRelease
Full 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
root level build.gradle:
buildscript {
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
kotlinVersion = "1.3.72"
supportLibVersion = "30.0.0"
supportVersion = "30.0.0"
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath ("com.android.tools.build:gradle:4.1.2")
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven {
// react-native-date-picker
url "https://www.jitpack.io"
}
maven { url "https://maven.google.com" }
}
}