1

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?

  • `jcenter()` was deprecated for a long time. Like, years, maybe 2 or 3 years even. For main libraries, there will be versions published under maven central, or their own repositories, depending on the library. You should check their respective documentations to find whether they have publications elsewhere. – Furkan Yurdakul Oct 31 '22 at 13:24
  • For example I've found the react-native library integration under here: https://reactnative.dev/docs/integration-with-existing-apps – Furkan Yurdakul Oct 31 '22 at 13:26
  • duplicate of https://stackoverflow.com/questions/74260926/could-not-head-https-jcenter-bintray-com-com-facebook-react-react-native-mave – Engr.Aftab Ufaq Oct 31 '22 at 19:06

4 Answers4

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.

1

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.

AmerllicA
  • 29,059
  • 15
  • 130
  • 154
0

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
                }
            }
        }
...
AmerllicA
  • 29,059
  • 15
  • 130
  • 154
PhilippeAuriach
  • 2,418
  • 2
  • 22
  • 41
0

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

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 12 '22 at 04:44