> Failed to list versions for com.google.http-client:google-http-client-android.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/google/http-client/google-http-client-android/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/google/http-client/google-http-client-android/maven-metadata.xml'.
> Read timed out
I was trying to build an Android app, but I got the above error. When I connect to “https://jcenter.bintray.com/com/google/http-client/google-http-client-android/maven-metadata.xml”, an nginx 403 error appears. Is JCenter down? What should I do?
CodePudding user response:
tldr;
Yes. jCenter is down right now. jCenter was sunset a while ago and remained available in read-only mode. So far no upadte on when it will be available again. Depending your situation, you have quick or not so-quick options for you.
Where can I check status?
update: New incident is reported here.
CodePudding user response:
for me solution from @dKen helped, but I've changed this like:
all { ArtifactRepository repo ->
println repo.url.toString()
if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
project.logger.warn "Repository ${repo.url} removed."
remove repo
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
CodePudding user response:
I am a Flutter developer. We have many third plugins. So just modifing every project's build.gradle too much heavy and can solve 'transitive dependency'. This is my solution.
cd ~/.gradle/
touch init.gradle
- copy below txt to init.gradle
allprojects{
repositories {
def REPOSITORY_URL = 'https://maven.aliyun.com/repository/jcenter'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
}
}
CodePudding user response:
Same problem, check the gradle status here https://status.gradle.com/
'JCenter downtime impact on resolution'
This also works for me
// jcenter()
def REPOSITORY_URL = "https://repo1.maven.org/maven2"
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
CodePudding user response:
Thank you everyone. I solved with this.
google()
mavenCentral()
gradlePluginPortal()
maven { url "https://jitpack.io" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
removing jcenter(), after that adding gradlePluginPortal() and maven { url "https://maven.aliyun.com/repository/jcenter" }