Home > Back-end >  Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml&
Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml&

Time:11-01

I created build yesterday and it was working fine . but when i try to create the relase build today i got this.

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-community_masked-view:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-community_masked-view:releaseRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native: .
     Required by:
         project :react-native-community_masked-view
      > 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 HEAD '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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 45s
5 actionable tasks: 5 up-to-date

i think the issue is due to jcenter deprication . any possible soultion or alternative of jcenter

CodePudding user response:

jcenter is down so until it comes online a temporary solution is just to disconnect from the internet and build your project, once the build is complete and the app launches you can connect back.

CodePudding user response:

From Hours of research if finally found that. this is an issue due to jcenter is down. According to [official documentation][1] the jcenter depricated and Bintray/JCenter users should start migrating to a new hosting solution. the solution for this is to remove jcenter from build file and replace it with

mavenCentral() // <- add it

for react-native users jcenter() may be exists in some depedency that you installed recently. to check for jcenter open your project in android-studio to check all build.gradle files easliy.

Another solution for this is that disconnect your system from internet and build your project. after you lanuc your project reconnect your system to internet. [1]: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

CodePudding user response:

The problem comes from the shutdown of jcenter. Event if you remove the repository for your app, you'll get errors if some of your declare jcenter().

The best way would be to have PRs merged and version update of those dependencies, but that might take a while.

In the mean time you can add the following in your android/app/build.gradle :

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

This fixed all my builds.

  • Related