skip to Main Content

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

Answers


  1. 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.

    Login or Signup to reply.
  2. 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
                    }
                }
            }
    ...
    
    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
  4. Reference links, [FIXED] Android build failures : https://github.com/facebook/react-native/issues/35210

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search