unable to get metadata from jcenter

185 views Asked by At

Error getting while creating release build in react native

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-community_clipboard:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-community_clipboard:releaseRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-community_clipboard
      > Failed to list versions for com.facebook.react:react-native.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
               > Read timed out

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

Error found during release build in react native

3

There are 3 answers

1
Mochamad Taufik Hidayat On

Currently jcenter down

Solution try replace jCenter() to mavenCentral() to your project gradle

 repositories {
        google()
        mavenCentral()
    }
0
steformicola On

As from here, replace jcenter() with mavenCentral() in your android/app/build.gradle.

0
AmerllicA On

Actually, based on the posted issue on Github a temporary solution could be like the following on the android/build.gradle file:

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

In my case, it was happing in one of node_modules's package and I used patch-package to keep the solution in the production.