jcenter.bintray.com is down Error: 502 Bad Gateway [closed]
When trying to build my project I am getting the following error:
Could not GET
'https://jcenter.bintray.com/androidx/lifecycle/lifecycle-common/maven-metadata.xml'.
Received status code 502 from server: Bad Gateway
- In my build.gradle repositories I don't have JCenter, so this error I'm getting is from dependencies that are still pointing to JCenter.
- Gradle offline mode is not the solution I'm expecting.
- I know that JCenter is down and that we should all move to Maven Central (I already did)
Is there a workaround?
It's a global outage in JCenter. You can monitor status at https://status.gradle.com. It replaces the bintray status page which seems is now fully sunset and returns a 502 error.
UPDATE Jan 13, 06:35 UTC
JCenter is now back online, and systems are fully operational.
UPDATE Jan 20
Gradle Plugin resolution outage postmortem
https://blog.gradle.org/plugins-jcenter
Following this incident, the Gradle Plugin Portal now uses a JCenter mirror hosted by Gradle instead of JCenter directly. This should shield users from short JCenter outages for libraries that have been cached by the mirror. We saw another short outage of JCenter over the weekend and this did not appear to impact Gradle Plugin Portal users.
JFrog, the maintainers of JCenter, announced that they are sunsetting JCenter. This means the following for Android developers for their app's dependencies:
- March 31st 2021 - Libraries in JCenter will no longer be updated.
- February 1, 2022 - JCenter will be completely shut down.
Add Maven Central to your project:
- Open your root build.gradle
- Find lines that say jcenter() and replace them with mavenCentral() (Make sure to add mavenCenteral() in both spots where jcenter() is found.)
.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral() // New line
// jcenter()
// NOTE: Keep any other entries you may have had here
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
//... no changes here
}
}
allprojects {
repositories {
google()
mavenCentral() // New line
// jcenter()
// NOTE: Keep any other entries you may have had here
}
}
You can find more here: https://blog.gradle.org/jcenter-shutdown
JCenter mentioned it was no longer going to work for new packages starting March 2021, something like that, but it was going to work indefinitely for read-only purposes. It seems right now it is down, but it should get back up sooner rather than later (crossing fingers).
Reference:
Into the Sunset on May 1st: Bintray, GoCenter, and ChartCenter
I had the same issue today. Since JCenter is being deprecated, we decided to move away from it now.
The problem I found is that the list of repositories used for Gradle plugins is different from the one you use to compile/run your application. Besides removing it from the repositories for your compile/runtime dependencies, you will also need to force Gradle to not use it for plugins. I added the following to my settings.gradle.kts
file:
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
See Custom Plugin Repositories.
I am facing the same issue. Using maven { url 'https://maven.aliyun.com/repository/jcenter' }
instead of jcenter
in the build.gradle file might resolve the issue, but it's not recommended since it's unofficial.