JCentre may be down permanently. What are our options?

263 Views Asked by At

I have been trying to build a react native app since the early hour of today but was getting the follwing errors:

> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out

After checking out https://jcenter.bintray.com, I found out it was down. Can anyone point me to the right option to resolve this issue? Is there any alternative since they said the site may not come back up?

4

There are 4 best solutions below

0
mohammad fakhraee On

I guess your question is already answered here.

As mentioned in this source:

No more submissions will be accepted to JCenter since March 31st, 2021.

So you should migrate all of your repositories to the alternative hosts such as mavenCentral.

0
PhilippeAuriach On

As stated in https://stackoverflow.com/a/74265617/772091 , dependencies can come with their own jcenter() repository. If you can wait for every dependency to be updated, you can force remove those repositories, using your android/app/build.gradle file :

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            if (repo instanceof MavenArtifactRepository) {
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    remove repo
                }
            }
        }
...
0
AmerllicA On

Based on the answered issue on Github, a temporary solution could be like the following:

android/build.gradle
all { ArtifactRepository repo ->
  if(repo instanceof MavenArtifactRepository){
    def url = repo.url.toString()
    if (url.startsWith('https://jcenter.bintray.com/')) {
      remove repo
    }
  }
}

if the issue came form node_modules you can use patck-package to keep the changes on production environment.

1
Vinh Nguyen On

Reference links, [FIXED] Android build failures : https://github.com/facebook/react-native/issues/35210