JCentre may be down permanently. What are our options?
Asked Answered
A

4

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?

Alcoholicity answered 31/10, 2022 at 13:19 Comment(3)
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.Rothschild
For example I've found the react-native library integration under here: reactnative.dev/docs/integration-with-existing-appsRothschild
duplicate of #74261426Toper
S
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.

Soleure answered 31/10, 2022 at 13:32 Comment(0)
P
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.

Papaveraceous answered 31/10, 2022 at 18:19 Comment(0)
F
0

As stated in https://mcmap.net/q/634643/-react-native-could-not-head-39-https-jcenter-bintray-com-com-facebook-react-react-native-maven-metadata-xml-39-duplicate , 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
                }
            }
        }
...
Fula answered 31/10, 2022 at 15:35 Comment(0)
C
0

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

Cairn answered 9/11, 2022 at 3:37 Comment(1)
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.Adalbert

© 2022 - 2025 — McMap. All rights reserved.