react-native: Android build failed: 'Failed to list versions for com.facebook.react:react-native.'

Description

  • What went wrong: Could not determine the dependencies of task ‘:app:compileDebugKotlin’.

Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’. Could not resolve com.facebook.react:react-native:+. Required by: project :app project :app > project :react-native-push-notification project :app > project :react-native-code-push project :app > project :react-native-async-storage_async-storage project :app > project :react-native-community_blur project :app > project :react-native-community_clipboard project :app > project :react-native-community_datetimepicker project :app > project :react-native-community_masked-view project :app > project :react-native-community_netinfo project :app > project :react-native-community_picker project :app > project :react-native-firebase_analytics project :app > project :react-native-firebase_app project :app > project :react-native-firebase_crashlytics project :app > project :sumsub_react-native-mobilesdk-module project :app > project :react-native-action-sheet project :app > project :react-native-appsflyer project :app > project :react-native-camera project :app > project :react-native-config project :app > project :react-native-device-info project :app > project :react-native-fbsdk-next project :app > project :react-native-file-viewer project :app > project :react-native-fs project :app > project :react-native-geolocation-service project :app > project :react-native-gesture-handler project :app > project :react-native-get-random-values project :app > project :react-native-haptic-feedback project :app > project :react-native-idfa project :app > project :react-native-image-crop-picker project :app > project :react-native-image-picker project :app > project :react-native-maps project :app > project :react-native-permissions project :app > project :react-native-safe-area-context project :app > project :react-native-screens project :app > project :react-native-set-soft-input-mode project :app > project :react-native-share project :app > project :react-native-shared-element project :app > project :react-native-sms-retriever project :app > project :react-native-splash-screen project :app > project :react-native-svg project :app > project :react-native-text-input-mask project :app > project :react-native-vector-icons project :app > project :react-native-version-number project :app > project :react-native-webview project :app > project :react-native-yamap 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

Version

0.65.1

Output of npx react-native info

System: OS: macOS 13.0 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 55.72 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.17.1 - ~/.nvm/versions/node/v16.17.1/bin/node Yarn: 3.1.1 - /usr/local/bin/yarn npm: 8.16.0 - ~/WebstormProjects/mono-front/node_modules/.bin/npm Watchman: 2022.08.15.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/magdaaa/.rvm/gems/ruby-2.7.4/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: 11.0.16 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.65.1 => 0.65.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

start to build android app

  • react-native run-android

Snack, code example, screenshot, or link to a repository

build.gradle

dependencies { … implementation “com.facebook.react:react-native:+” … }

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 96
  • Comments: 273 (6 by maintainers)

Most upvoted comments

JCenter and Bintray shut down today.

android/build.gradle

allprojects {
    repositories {
        ...
        // jcenter()
        def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        ...
    }
}

before rebuild run:

cd android && ./gradlew clean && cd ..

Hey everyone,

I tweaked a few things in my build.gradle file to emulate what this build.gradle looks like and my build errors went away

remove jcenter references and use mavenCentral

Hope this fixes everyone 😃

Raise funds to buy jcenter.

Switch off the internet when building the package works for me. I think that’s just a temporary solution. But at least it worked!

gradlePluginPortal()

It’s works.

Finally after hours of head bangs, issue resolved. No need to edit node_modules. In android/build.gradle add the following at the top in all projects -> repositories It should look something like this

    allprojects {
      repositories {
          all { ArtifactRepository repo ->
              println repo.url.toString()
              if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                  project.logger.warn "Repository ${repo.url} removed."
                  remove repo
                  mavenCentral()
              }
          }
         gradlePluginPortal() // add this if you get further errors
          ...other repos
      }
    }

What it does: It will remove jcenter() from all the projects during config phase and replace it with mavenCentral() Viola 🥳

It may be stupid but work for me it is replace all jcenter() in your project even node_module by mavenCentral()

Its works

I added ArtifactRepository repo line and I changed mavenCentral() instead of jCenter() and solved from my side

    repositories {
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        gradlePluginPortal()
        gradlePluginPortal() {
        content {
            includeModule("cn.aigestudio.wheelpicker", "WheelPicker")
        }
    }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}```

@kurisu994

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://repo.huaweicloud.com/repository/maven' }
        maven { url 'https://jitpack.io' }
        mavenCentral()
        google()
//       jcenter()
//        jcenter {
//            content {
//                excludeGroup "com.facebook.react"
//                excludeGroup "net.minidev"
//                excludeGroup "com.nimbusds"
//            }
//        }
        def REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }

        //hms
        maven {url 'http://developer.huawei.com/repo/'}
        //fcm
        maven { url "https://maven.google.com" }
        maven { url "https://plugins.gradle.org/m2/" }

        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

    }
    configurations {
        all*.exclude group: 'com.google.firebase:firebase-common', module: 'firebase-common'
        all*.exclude group: 'com.google.firebase', module: 'firebase-components'
    }
}

@olcaneristi

https://bintray.com/ says 410 gone and https://jcenter.bintray.com/ says 403 forbidden

edit: to those who are confused

410 Gone The HyperText Transfer Protocol (HTTP) 410 Gone client error response code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent.

Could you guys try this and check if it works (in case you still using some library on jcenter)? So it seems not all jcenter repo down

    jcenter {
        content {
            excludeGroup "com.facebook.react"
            excludeGroup "net.minidev"
            excludeGroup "com.nimbusds"
        }
    }

disconnect from internet and build

As the Gradle is down , I guess the best solution will be to switch your internet off and run the app it worked for me !

is there any update on this?

replacing jcenter() to mavenCentral() works.

Some resume.

There are several options you can try:

  1. Replacejcenter() with mavenCentral() - if you have no any 3d-party dependencies with jcenter()
  2. Replace jcenter() with mavenCentral() and update 3d-party dependencies to the versions where jcenter() not used
  3. Replace jcenter() with gradlePluginPortal() - If you can’t fast update 3d-party dependencies at the moment (see here)
  4. Use http://maven.aliyun.com/nexus repo (see here)
  5. Exclude problematic groups to download from jcenter (see here)

Before trying this clean node_modules and execute ./gradlew clean

Incident resolved

https://status.gradle.com

403 forbidden 😦 we’ll wait and see…

https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml

Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :app
         project :app > project :react-native-netmera
         project :app > project :react-native-share
         ....
      > 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'.

Disconnect your internet and then build your app, its working

I get a similar error with an expo managed rn app:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-pager-view:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-pager-view:releaseRuntimeClasspath'.

   > Could not resolve com.facebook.react:react-native:+.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
     Required by:

         project :react-native-pager-view
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
      > 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

Temporary solution: Most of the packages use jcenter() and mavenCentral() both. You need to replace jcenter() by gradlePluginPortal() from the build.gradle file of the packages that you have used in your project in order to run it. To do so, select jcenter() from android>build.gradle and press Command + Shift + F as shown in the image

image

You can skip the README.md, jarRepositories.xml and CHANGELOG.md files

is there any update on this?

replacing jcenter() to mavenCentral() works.

as i said i have tried all the possible ways but still not fixed it.

it works for me

image image

def REPOSITORY_URL = 'https://maven.aliyun.com/repository/public'
       all { ArtifactRepository repo ->
           if(repo instanceof MavenArtifactRepository){
               def url = repo.url.toString()
               if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                   project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                   remove repo
               }
           }
       }
       maven {
           url REPOSITORY_URL
       }

Incident resolved

https://status.gradle.com

JCenter works well right now and builds successfully completed with my default configs. (not removing JCenter or replacing with gradlePluginPortal etc). FYI

JCenter works now. But you never know when jcenter will die again. We must deal with this situation.

replacing jcenter() by gradlePluginPortal() works for me , but i thinks it’s just a temporary solution .

It’s work for me. 😁

@mowaisch no, dont remove that. so mine is something like this on root/build.gradle --> allProject{}:

    mavenCentral {
        // exclude react-native from MavenCentral
        content {
            excludeGroup "com.facebook.react"
        }
    }
    
    jcenter {
        content {
            excludeGroup "com.facebook.react"
            excludeGroup "net.minidev"
            excludeGroup "com.nimbusds"
        }
    }

Has been restored. JCenter works now.

@Alipatel05

thats the problem i dont have android folder in my expo project. 🤕

you can eject your app to ExpoKit or react native CLI. https://docs.expo.dev/expokit/eject/

@ahmdshrif brother i cannot eject i need to publish my app ASAP, my most of the dependencies are based on expo and my project contains more than 150 dependencies.

replacing jcenter() by gradlePluginPortal() works for me , but i thinks it’s just a temporary solution .

still have issue

安卓/build.gradle

allprojects {
    repositories {
        ...
        // jcenter()
        def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        ...
    }
}

在重建运行之前:

cd android && ./gradlew clean && cd ..

android -> build.gradle


allprojects {
    repositories {
        .
        .
        .
        maven {
            url("https://maven.aliyun.com/nexus/content/groups/public/")
        }

        // jcenter()
        .
        .
        .
    }
}

This worked for me, thank you.

Same! No libs were changed either 😕 Screen Shot 2022-10-30 at 3 36 34 PM

Screen Shot 2022-11-07 at 13 34 29 i check the website is 403 bro

is JScenter down again?

Nope

Check this issue #35210 hope this help

I replaced the jcenter() with mavenCentral() and it still doesn’t work for me. Does anyone have any solution please? image

gradlePluginPortal() mavenCentral() replace jcenter with above

replacing jcenter to mavenCentral causes another error

`Could not determine the dependencies of task ‘:app:mergeDebugAssets’.

Could not resolve all task dependencies for configuration ‘:app:debugRuntimeClasspath’. Could not find com.eightbitlab:blurview:1.6.6. Searched in the following locations: - file:/Users/muhammadowais/workspace/kiriDating/node_modules/react-native/android/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - file:/Users/muhammadowais/workspace/kiriDating/node_modules/jsc-android/dist/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://maven.google.com/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://www.jitpack.io/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://repo.maven.apache.org/maven2/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://dl.google.com/dl/android/maven2/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom Required by: project :app Could not find com.eightbitlab:blurview:1.6.6. Searched in the following locations: - file:/Users/muhammadowais/workspace/kiriDating/node_modules/react-native/android/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - file:/Users/muhammadowais/workspace/kiriDating/node_modules/jsc-android/dist/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://maven.google.com/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://www.jitpack.io/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://repo.maven.apache.org/maven2/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom - https://dl.google.com/dl/android/maven2/com/eightbitlab/blurview/1.6.6/blurview-1.6.6.pom Required by: project :app > project :react-native-community_blur Could not find com.twitter.sdk.android:twitter-core:3.3.0. Searched in the following locations: - file:/Users/muhammadowais/workspace/kiriDating/node_modules/react-native/android/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom - file:/Users/muhammadowais/workspace/kiriDating/node_modules/jsc-android/dist/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom - https://maven.google.com/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom - https://www.jitpack.io/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom - https://repo.maven.apache.org/maven2/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom - https://dl.google.com/dl/android/maven2/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.pom Required by: project :app > project :react-native-twitter-signin_twitter-signin Could not find com.yqritc:android-scalablevideoview:1.0.4. Searched in the following locations: - file:/Users/muhammadowais/workspace/kiriDating/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom - file:/Users/muhammadowais/workspace/kiriDating/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom - https://maven.google.com/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom Required by: project :app > project :react-native-video`

I was able to fix my build. Apparently jcenter is down. It was already deprecated for some time now. I am not sure if it is finally down forever now or if this is temporary.

I had to update all dependencies that still used jcenter to the newest version. Most of them replaced jcenter with maven already. One I had to manually patch with https://github.com/ds300/patch-package myself.

After that my build worked again.

In android/build.gradle

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            if (repo.hasProperty("url") && repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                project.logger.warn "Repository ${repo.url} removed."
                remove repo
                mavenCentral()
            }
        }

Its works

I added ArtifactRepository repo line and I changed mavenCentral() instead of jCenter() and solved from my side

    repositories {
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        gradlePluginPortal()
        gradlePluginPortal() {
        content {
            includeModule("cn.aigestudio.wheelpicker", "WheelPicker")
        }
    }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}```

This is worked for me after trying a lot of things that were commented on here !!! Thanx

Hello,

Same problem, in my case I can’t replace jcenter with mavenCentral because I need it for some old libraries.

JCenter is deprecated

UPDATE

  • JFrog has decided to keep JCenter as a read-only repository indefinitely. New package and versions are no longer accepted on JCenter. All Bintray services have been shutdown.

I am going to tell you how to solve the problem, not only is it enough to replace jcenter with maven in the build.gradle of the application, this must also be done in the build.gradel of each package within node_modules, you have several ways to do it for example creating forks of those libraries or use the script above from @Orange9000

"replace": "cd node_modules && grep -ilr 'jcenter()' * | xargs -I@ sed -i '' 's/jcenter()/mavenCentral()/g' @",

This script should be run after yarn install and it will replace everything in jcenter with maven, this takes a few minutes.

However, I have followed all the methods mentioned above. Until able to solve the problem for the application to run, but it still has many bugs, such as the keyboard of the input shows. And quickly shut down and unable to build apps as releases (.APK and .AAB). Hope there is a better solution.

I confirm that for 0.64.2 gradlePluginPortal() replacing jcenter() works, but the build is extremely slow. So consider it as temporary work around!

Switch off the internet when building the package works for me. I think that’s just a temporary solution. But at least it worked!

This worked for me. But we need a proper solution.

@a554878526 @orchsik

jcenter has shutdown in the last 24 hours I think.

You should grep "jcenter" and see which modules in your project contain references to it still. Upgrade those packages, if they have fixed it in a new release, or replace jcenter with mavenCentral in the package files yourself and use patch-package to maintain the change

I’ve just finished doing this and found many packages actually fixed this and just required an update to the version of those packages.

GL ✌️

@stephanrotolante can you help me share your complete build.gradle ?. because i already remove jcenter but still got error. Thanks

What work for me in android/build.gradle i remove jcenter() and add mavenCentral() and maven { url 'https://maven.testfairy.com' } to be like this image and in app/build.gradle i add implementation 'com.testfairy:testfairy-android-sdk:1.+@aar' image after that if you still get the error you will get it in a specific library you can try to remove and install the last one i got in react-native-video i just removed it and install it again and it’s work for me

Its works

I added ArtifactRepository repo line and I changed mavenCentral() instead of jCenter() and solved from my side

    repositories {
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        gradlePluginPortal()
        gradlePluginPortal() {
        content {
            includeModule("cn.aigestudio.wheelpicker", "WheelPicker")
        }
    }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}```

This seems to be the best solution and it workerd for me.

Inside the android/build.gradle file, I have replace the jcenter() with gradlePluginPortal() and it’s working for me.

Replace jcenter() with mavenCentral( ) & gradlePluginPortal( ) in android/build.gradle, it works

I was able to fix my build. Apparently jcenter is down. It was already deprecated for some time now. I am not sure if it is finally down forever now or if this is temporary.

I had to update all dependencies that still used jcenter to the newest version. Most of them replaced jcenter with maven already. One I had to manually patch with https://github.com/ds300/patch-package myself.

After that my build worked again.

@mauricedoepke The same problem exists with Expo 43.0. Can you tell me the details or commands?

This works

        // jcenter()
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }

this solution work for me thanks

但似乎 jcenter 又回来了,不是吗?

doesn’t seem to, 403 :https://jcenter.bintray.com/

also happen to me! and replacing jcenter() to mavenCentral() not work for me !!!

From what I’ve understood, If you haven’t cleaned your project recently, you can switch off the internet and it will build just fine.

But if you wanted to create a release build/test apk and you’ve cleaned beforehand, you’ll need jcenter to work if you have dependencies that exist on jCenter, but not on maven.

In my case I’ve migrated from 0.60.5 fo 0.66.4 a long time ago, but I hadn’t fully upgraded the packages to be supported by maven. So I hadn’t deleted jcenter().

This is what happened before removing jCenter().

…Could not determine the dependencies of task ‘:app:lintVitalRelease’.

Could not resolve all artifacts for configuration ‘:app:debugRuntimeClasspath’. Could not resolve com.facebook.react:react-native:+. Required by: project :app project :app > project :react-native-share …

After removing jCenter():

  • What went wrong: Could not determine the dependencies of task ‘:app:lintVitalRelease’.

Could not resolve all artifacts for configuration ‘:app:debugCompileClasspath’. Could not find com.otaliastudios:cameraview:2.7.0. …

So I had to find replacements for the listed dependencies from maven, and the errors disappeared one by one. I have 25+ dependencies though… I hope they fix this soon…

I’m having the same problem

You’re not alone, experiencing same error

BUILD FAILED in 1m 47s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ‘:app:mergeDebugAssets’.

Could not resolve all task dependencies for configuration ‘:app:debugRuntimeClasspath’. Could not resolve com.facebook.react:react-native:+. Required by: project :app project :app > project :notifee_react-native project :app > project :react-native-community_masked-view project :app > project :react-native-firebase_app project :app > project :react-native-firebase_messaging project :app > project :react-native-picker_picker project :app > project :react-native-aes-crypto project :app > project :react-native-biometrics project :app > project :react-native-camera project :app > project :react-native-device-info project :app > project :react-native-document-picker project :app > project :react-native-document-scanner-plugin project :app > project :react-native-file-access project :app > project :react-native-gesture-handler project :app > project :react-native-get-random-values project :app > project :react-native-image-crop-picker project :app > project :react-native-mlkit-ocr project :app > project :react-native-permissions project :app > project :react-native-safe-area-context project :app > project :react-native-screens project :app > project :react-native-splash-screen project :app > project :react-native-svg project :app > project :react-native-vector-icons project :app > project :realm 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

Steps to reproduce are the same.

is jcenter down again?

gradlePluginPortal() worked for me

In android/build.gradle

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            if (repo.hasProperty("url") && repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                project.logger.warn "Repository ${repo.url} removed."
                remove repo
                mavenCentral()
            }
        }

it’s work but it’s not correct way to resolve

Yes I also had success w/ this, but I consider it a bandaid until the community can align on a more permanent fix.

Inside the android/build.gradle file, I have replace the jcenter() with gradlePluginPortal() and it’s working for me.

I cannot take a signed APK Build. It showed me the error in the npm packages.

check above solutions

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            println repo.url.toString()
            if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                project.logger.warn "Repository \${repo.url} removed."
                remove repo
                mavenCentral()
            }
        }

For me this changes were needed to solve it:

  • move google() to top
  • replace jcenter() with gradlePluginPortal()

image

Simple package.json script to replace every occurrence of jcenter() in your node_modules. No patching required, works on MacOS. Run yarn replace command in a console.

"replace": "cd node_modules && grep -ilr 'jcenter()' * | xargs -I@ sed -i '' 's/jcenter()/mavenCentral()/g' @",

gradlePluginPortal() mavenCentral() replace jcenter with above

worked for me +1

Finally after hours of head bangs, issue resolved. No need to edit node_modules. In android/build.gradle add the following at the top in all projects -> repositories It should look something like this

    allprojects {
      repositories {
          all { ArtifactRepository repo ->
              println repo.url.toString()
              if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                  project.logger.warn "Repository ${repo.url} removed."
                  remove repo
                  mavenCentral()
              }
          }
          ...other repos
      }
    }

What it does: It will remove jcenter() from all the projects during config phase and replace it with mavenCentral() Viola 🥳

Above both solution works for me this script also remove jcenter from transitive dependencies

JCenter downtime impact on resolutionSubscribe Identified - While the mirroring put in place alleviates some of the JCenter being down impact, the mirror is a bit out of date and currently cannot sync recent artifacts. This continues to impact builds. Oct 31, 2022 - 09:56 UTC

Let’s wait out a bit.

show the build gradle of react-native-video

dependencies { implementation “com.facebook.react:react-native:${safeExtGet(‘reactNativeVersion’, ‘+’)}” implementation(‘com.google.android.exoplayer:exoplayer:2.13.2’) { exclude group: ‘com.android.support’ }

// All support libs must use the same version
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.core:core:1.1.0"
implementation "androidx.media:media:1.1.0"

implementation('com.google.android.exoplayer:extension-okhttp:2.13.2') {
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation 'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'

}

change the 2.13.2 -> 2.13.3

I can able to run now thank you

tried ./gradlew clean and commented jcenter() still have issue…

* What went wrong:
A problem occurred configuring root project 'RNAppToPhone'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:aaptcompiler:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.lint:lint-gradle-api:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:gradle-api:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:builder-model:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:manifest-merger:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.analytics-library:tracker:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.lint:lint-gradle-api:27.1.2 > com.android.tools.lint:lint-model:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2 > com.android.tools:repository:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2 > com.android.tools.analytics-library:shared:27.1.2
   > Could not find org.ow2.asm:asm:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find org.ow2.asm:asm-analysis:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find org.ow2.asm:asm-commons:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find org.ow2.asm:asm-util:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find net.sf.jopt-simple:jopt-simple:4.9.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find net.sf.proguard:proguard-gradle:6.0.3.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/net/sf/proguard/proguard-gradle/6.0.3/proguard-gradle-6.0.3.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find com.squareup:javapoet:1.10.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/squareup/javapoet/1.10.0/javapoet-1.10.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
   > Could not find com.google.protobuf:protobuf-java:3.10.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:aapt2-proto:4.1.2-6503028
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.ddms:ddmlib:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.analytics-library:protos:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.analytics-library:tracker:27.1.2
   > Could not find com.google.protobuf:protobuf-java-util:3.10.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find com.google.crypto.tink:tink:1.3.0-rc2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find com.google.flatbuffers:flatbuffers-java:1.12.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/flatbuffers/flatbuffers-java/1.12.0/flatbuffers-java-1.12.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/tensorflow/tensorflow-lite-metadata/0.1.0-rc1/tensorflow-lite-metadata-0.1.0-rc1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2
   > Could not find com.squareup:javawriter:2.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find org.bouncycastle:bcpkix-jdk15on:1.56.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:apkzlib:4.1.2
   > Could not find org.bouncycastle:bcprov-jdk15on:1.56.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:apkzlib:4.1.2
   > Could not find org.ow2.asm:asm-tree:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-tree/7.0/asm-tree-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find javax.inject:javax.inject:1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/javax/inject/javax.inject/1/javax.inject-1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
   > Could not find it.unimi.dsi:fastutil:7.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find com.googlecode.json-simple:json-simple:1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2
   > Could not find com.google.guava:guava:28.1-jre.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/guava/guava/28.1-jre/guava-28.1-jre.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:aaptcompiler:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.analytics-library:crash:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.lint:lint-gradle-api:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:gradle-api:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:common:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.analytics-library:tracker:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2 > com.android.tools.analytics-library:shared:27.1.2
   > Could not find org.apache.httpcomponents:httpmime:4.5.6.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.analytics-library:crash:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2
   > Could not find org.apache.httpcomponents:httpcore:4.4.10.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.analytics-library:crash:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2
   > Could not find org.apache.httpcomponents:httpclient:4.5.6.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.analytics-library:crash:27.1.2
   > Could not find org.jetbrains.kotlin:kotlin-reflect:1.3.72.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.3.72/kotlin-reflect-1.3.72.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.lint:lint-gradle-api:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
   > Could not find org.antlr:antlr4:4.5.3.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/antlr/antlr4/4.5.3/antlr4-4.5.3.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
   > Could not find commons-io:commons-io:2.4.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
   > Could not find com.googlecode.juniversalchardet:juniversalchardet:1.0.3.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
   > Could not find com.google.code.gson:gson:2.8.5.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:manifest-merger:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2 > com.android.tools.analytics-library:shared:27.1.2
   > Could not find org.glassfish.jaxb:jaxb-runtime:2.3.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > androidx.databinding:databinding-compiler-common:4.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2 > com.android.tools:repository:27.1.2
   > Could not find com.google.auto.value:auto-value-annotations:1.6.2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/auto/value/auto-value-annotations/1.6.2/auto-value-annotations-1.6.2.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:bundletool:0.14.0
   > Could not find com.google.errorprone:error_prone_annotations:2.3.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:bundletool:0.14.0
   > Could not find com.google.guava:guava:28.1-jre.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/guava/guava/28.1-jre/guava-28.1-jre.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:bundletool:0.14.0
   > Could not find com.google.protobuf:protobuf-java:3.10.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:bundletool:0.14.0
   > Could not find com.google.protobuf:protobuf-java-util:3.10.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:bundletool:0.14.0
   > Could not find com.google.code.gson:gson:2.8.5.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-core:1.0.0-beta09
   > Could not find org.jetbrains.kotlin:kotlin-stdlib:1.3.60.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.60/kotlin-stdlib-1.3.60.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-core:1.0.0-beta09
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09
   > Could not find org.ow2.asm:asm:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09
   > Could not find org.ow2.asm:asm-util:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09
   > Could not find org.ow2.asm:asm-commons:7.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09
   > Could not find org.jdom:jdom2:2.0.6.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09
   > Could not find org.apache.commons:commons-compress:1.12.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/apache/commons/commons-compress/1.12/commons-compress-1.12.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2 > com.android.tools:repository:27.1.2
   > Could not find org.jetbrains.trove4j:trove4j:20160824.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdk-common:27.1.2
   > Could not find net.sf.kxml:kxml2:2.3.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:manifest-merger:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.ddms:ddmlib:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:aaptcompiler:4.1.2 > com.android.tools.layoutlib:layoutlib-api:27.1.2
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.lint:lint-gradle-api:27.1.2 > com.android.tools.lint:lint-model:27.1.2
   > Could not find com.google.code.findbugs:jsr305:1.3.9.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:apkzlib:4.1.2
   > Could not find com.google.guava:guava:28.1-jre.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/guava/guava/28.1-jre/guava-28.1-jre.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools.build:apkzlib:4.1.2
   > Could not find org.jetbrains:annotations:13.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/annotations/13.0/annotations-13.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:aaptcompiler:4.1.2 > com.android.tools.layoutlib:layoutlib-api:27.1.2
   > Could not find com.sun.activation:javax.activation:1.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2 > com.android.tools:repository:27.1.2
   > Could not find com.google.jimfs:jimfs:1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:4.1.2 > com.android.tools.build:builder:4.1.2 > com.android.tools:sdklib:27.1.2 > com.android.tools:repository:27.1.2

Most of our apps are old versions of npm. There are too many jcenter dependencies that can be changed at once. Is there any other way besides updating the npm?

I had to comment out the jcenter() commands in build.gradle. If it is required by any of your libraries, you would need to check if there is a newer version of the library, which does not need it.

Obviously, you will need to delete the following folders (if any of them exists) before trying to rebuild your app. android/.grdale, android/.idea, android/build & android/app/build

This is a duplicate of #35210

is JScenter down again?

Nope

Check this issue https://github.com/facebook/react-native/issues/35210 hope this help

Facing new error now…

Execution failed for task ‘:react-native-community_datetimepicker:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

Facing new error now…

D:\Projects\MobileApp\poimobileapp\node_modules@react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\Common.java:57: error: lambda expressions are not supported in -source 7 return presentedDialog -> { ^ (use -source 8 or higher to enable lambda expressions) 1 error

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-community_datetimepicker:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

It work for now. Can be build normal 🚀🚀🚀🚀🚀🚀

JCenter works well right now and builds successfully completed with my default configs. (not removing JCenter or replacing with gradlePluginPortal etc). FYI

Does anyone know why?

@eesttiwar check this out fixed this at morning today gitIssu_fixed

I was able to build my project in release mode with this fix

Adding this in android/build.gradle (like most of the answers here)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 26
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
    }
    repositories {
        google()
        mavenLocal()
        mavenCentral()

    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.1")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
    }
}

allprojects {
    repositories {
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        all { ArtifactRepository repo ->
            if (repo instanceof MavenArtifactRepository) {
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} dropped"
                    remove repo
                }
            }
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            url 'https://maven.google.com'
        }
        maven {
            url "https://www.jitpack.io"
        }
        google()

    }
}

Additionally, Had to add this in android/app/build.gradle

 lintOptions {
        checkReleaseBuilds false
 }

I don’t know how dangerous is the lintOptions - but it worked for me.

Good luck!

✅ This works for me. Worth to try 👍

VS CODE SETTING

  1. Create settings.json file inside (app_root_folder)/.vscode/
Screen Shot 2022-10-31 at 9 56 43 PM
  1. Inside settings.json:
{
  "search.useIgnoreFiles": true,
  "search.exclude": {
    "**/node_modules": false
  }
}

START SEARCHING

Search all jcenter() inside the project folder including in node_modules

Screen Shot 2022-10-31 at 9 57 36 PM

REPLACE ALL OF THEM

Replace jcenter() with mavenCentral()

Screen Shot 2022-10-31 at 10 14 18 PM Screen Shot 2022-10-31 at 10 14 07 PM

START BUILDING

Try if it works by yarn android

INSTALL patch-package

If that works, now use patch-package library (https://www.npmjs.com/package/patch-package) so the patches will be applied back after you or your teammate need to do yarn install (reinstalling node_modules).

START PATCHING LIBRARIES

Patch your modified libraries using (I’m using yarn): yarn patch-package <your_library_name>

COMMIT THE CHANGES

Add and commit your modified files, including <your_library_name+x.x.x>.patch patch file into your repository.

Hope this helps!

I am not using expo

buildscript {
    ext {
        //https://developer.android.com/studio/releases/build-tools?hl=ko
        buildToolsVersion = "30.0.3"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        //https://developer.android.com/topic/libraries/support-library/revisions?hl=ko
        supportLibVersion = "28.0.0"
    }
    repositories {
        mavenCentral()
        google()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.2'
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

project.ext {
    set('react-native', [
            versions: [
                    // Overriding Build/Android SDK Versions
                    android : [
                            minSdk    : 21,
                            targetSdk : 31,
                            compileSdk: 31,
                            buildTools: "30.0.3"
                    ],

                    // Overriding Library SDK Versions
                    firebase: [
                            // Override Firebase SDK Version
                            bom           : "29.2.1"
                    ],
            ],
    ])
}

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            println repo.url.toString()
            if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                project.logger.warn "Repository \${repo.url} removed."
                remove repo
                mavenCentral()
            }
        }

        mavenLocal()
        google()

        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            content {
                excludeGroup "com.faceook.react"
            }
        }
        mavenCentral()
        gradlePluginPortal()
        maven { url "https://maven.google.com" }
        maven { url "https://www.jitpack.io" }
    }
}

Its works I added ArtifactRepository repo line and I changed mavenCentral() instead of jCenter() and solved from my side

    repositories {
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        gradlePluginPortal()
        gradlePluginPortal() {
        content {
            includeModule("cn.aigestudio.wheelpicker", "WheelPicker")
        }
    }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}```

This is worked for me after trying a lot of things that were commented on here !!! Thanx

Thanks, this worked for me.

all { ArtifactRepository repo -> println repo.url.toString() if (repo.url.toString().startsWith(“https://jcenter.bintray.com/”)) { project.logger.warn “Repository ${repo.url} removed.” remove repo mavenCentral() }

Can you share full screen screenshot?

Its works

I added ArtifactRepository repo line and I changed mavenCentral() instead of jCenter() and solved from my side

    repositories {
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        gradlePluginPortal()
        gradlePluginPortal() {
        content {
            includeModule("cn.aigestudio.wheelpicker", "WheelPicker")
        }
    }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}```

This solved most of my issues. The only other thing I had to do was update a few dep’s versions which were somehow different between JCenter and Maven. For example, I was using version 1.8.1 of a dep and Maven only had 1.8.0 and 1.9.0 so I switched to 1.9.0.

Hi, I replaced all jcenter() to mavenCentral() and gradlePluginPortal() but it doesn’t solve the problems. FYI, I’m now using expo with React Native. image Following is the error log. image

@mchan822 hi i’m using expo too but we cannot modify build.gradle directly from node_modules. And we dont have access to build.gradle aswell we need to find some proper workaround for this. If you have find the solution please help me too.

check above solutions

allprojects {
    repositories {
        all { ArtifactRepository repo ->
            println repo.url.toString()
            if (repo.url.toString().startsWith("https://jcenter.bintray.com/")) {
                project.logger.warn "Repository \${repo.url} removed."
                remove repo
                mavenCentral()
            }
        }

it works to me

I adding in allprojects > repositories and worked for me

gradlePluginPortal() maven { url "https://maven.aliyun.com/repository/jcenter" }

Good morning, I have no reference to jcenter in my gradle file, I can validate that everything there is maven, but I am having the same problem.

Execution failed for task ‘:app:lintVitalStageRelease’. Could not resolve all artifacts for configuration ‘:react-native-ad-manager:releaseRuntimeClasspath’. Could not resolve com.facebook.react:react-native:+. Required by: project :react-native-ad-manager 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`

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        maven { url 'https://www.jitpack.io' }

        maven {
            url 'https://repo.brightcove.com/releases'
        }
    }
}

all { ArtifactRepository repo -> println repo.url.toString() if (repo.url.toString().startsWith(“https://jcenter.bintray.com/”)) { project.logger.warn “Repository ${repo.url} removed.” remove repo mavenCentral() } }

Does anybody want to share an expo config plugin for that?..

gradlePluginPortal() mavenCentral() replace jcenter with above

worked for me

disconnect from internet and build worked for me

gradlePluginPortal() mavenCentral() replace jcenter with above

I succeeded to build app with this solution 👍

sasaw

it’s not working for me… i tried 3x times…

@farooqalam20996 you need to put them in the first row。

repositories {
    def ......
    all ......
    .
    .
    .
}

Tried but not working

Those who’s still having issues, go to build.gradle , see if you have jcenter() in the file, comment or remove this line.

This works

        // jcenter()
        def REPOSITORY_URL = "https://repo1.maven.org/maven2"
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }

@kurisu994

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://repo.huaweicloud.com/repository/maven' }
        maven { url 'https://jitpack.io' }
        mavenCentral()
        google()
//       jcenter()
//        jcenter {
//            content {
//                excludeGroup "com.facebook.react"
//                excludeGroup "net.minidev"
//                excludeGroup "com.nimbusds"
//            }
//        }
        def REPOSITORY_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }

        //hms
        maven {url 'http://developer.huawei.com/repo/'}
        //fcm
        maven { url "https://maven.google.com" }
        maven { url "https://plugins.gradle.org/m2/" }

        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

    }
    configurations {
        all*.exclude group: 'com.google.firebase:firebase-common', module: 'firebase-common'
        all*.exclude group: 'com.google.firebase', module: 'firebase-components'
    }
}

With all the url in, it worked. This was a good solution for me. Thank you.

I Solved the Issue with these things.

  1. Delete Nodemodules and .gradle folder
  2. Replace jcenter() with gradlePluginPortal() in build.gradle file.
buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 29
        compileSdkVersion = 31
        targetSdkVersion = 30
        androidXCore = "1.6.0"
        googlePlayServicesAuthVersion="17.0.0"
    }
    repositories {
        google()
       gradlePluginPortal()  // New Change
    }
    
    dependencies {
        classpath("com.android.tools.build:gradle:4.0.2")
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10'
        //  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
    //      maven { url "https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp" }
    // maven { url "https://developer.huawei.com/repo/" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
            maven {
      url "https://cashshield-sdk.s3.amazonaws.com/release/"
    }

        gradlePluginPortal() //New Change
        // maven { url 'https://dl.bintray.com/ironsource-mobile/android-sdk' }
        maven { url 'https://www.jitpack.io' }
        maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
        //  maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
        // maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    }
}
  1. npm i --force

This worked. Thank you so much!

android/build.gradle

allprojects {
    repositories {
        ...
        // jcenter()
        def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
        ...
    }
}

before rebuild run:

cd android && ./gradlew clean && cd ..

This worked for me. Thank You !!

I Solved the Issue with these things.

  1. Delete Nodemodules and .gradle folder

  2. Replace jcenter() with gradlePluginPortal() in build.gradle file.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 29
        compileSdkVersion = 31
        targetSdkVersion = 30
        androidXCore = "1.6.0"
        googlePlayServicesAuthVersion="17.0.0"
    }
    repositories {
        google()
       gradlePluginPortal()  // New Change
    }
    
    dependencies {
        classpath("com.android.tools.build:gradle:4.0.2")
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10'
        //  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
    //      maven { url "https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp" }
    // maven { url "https://developer.huawei.com/repo/" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
            maven {
      url "https://cashshield-sdk.s3.amazonaws.com/release/"
    }

        gradlePluginPortal() //New Change
        // maven { url 'https://dl.bintray.com/ironsource-mobile/android-sdk' }
        maven { url 'https://www.jitpack.io' }
        maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
        //  maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
        // maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    }
}

  1. npm i --force

Hi my friends,

I tried with this solution and it worked for me. You can refer this:

  1. In top/build.gradle
  • Remove Jcenter and replacing with maven
  • Edit allprojects/repositories such as image Screen Shot 2022-10-31 at 2 34 43 PM
  1. Update Android Gradle Plugin to 7 or newer classpath(‘com.android.tools.build:gradle:7.2.2’) distributionUrl=https://services.gradle.org/distributions/gradle-7.4-bin.zip
  2. Try to rebuild application with new configuration

Hope you all can resolve your issue

Try node install after replacing jcenter() to mavenCentral() ? Tell us your results. i run node install and then result

 Required by:
         project :app > com.facebook.flipper:flipper-fresco-plugin:0.75.1
         project :app > com.facebook.flipper:flipper-fresco-plugin:0.75.1 > com.facebook.fresco:flipper:2.2.0
   > Could not find com.facebook.fresco:stetho:2.2.0.

using mavenCentral() to replace jcenter() fixes ./gradlew clean but while building the android application using yarn leads to: Execution failed for task ‘:app:checkDebugAarMetadata’.

Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’. Could not find com.facebook.fresco:stetho:2.2.0. Searched in the following locations:

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

BUILD FAILED in 44s

at makeError (/home/user/FCS/fleet-compliance-driver-app-android/node_modules/execa/index.js:174:9)
at /home/user/FCS/fleet-compliance-driver-app-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (/home/user/FCS/fleet-compliance-driver-app-android/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/user/FCS/fleet-compliance-driver-app-android/node_modules/@react-native-community/cli/build/index.js:192:9)

info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

try upgrade flipper, latest version of Flipper requires react-native 0.69+! If you use react-native < 0.69.0, please use 0.162.0

Still not working for me

worked for me replacing jcenter() to mavenCentral()

Switch off the internet when building the package works for me

Worked for me as well 👍🏻

I had to comment out the jcenter() commands in build.gradle. If it is required by any of your libraries, you would need to check if there is a newer version of the library, which does not need it.

Obviously, you will need to delete the following folders (if any of them exists) before trying to rebuild your app. android/.grdale, android/.idea, android/build & android/app/build

Hello,

I am still facing the same issue when building new release app, works pretty well with debug app Looking for an update really soon.

Thanks!

@nyomanyudis95 try running a gradle clean, then rebuild

buildscript {
    ext {
        buildToolsVersion = "30.0.3"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        androidXCore = "1.7.0"
        kotlinVersion = "1.6.0"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:7.1.2')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../../../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../../../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://www.jitpack.io' }
    }

}

@olcaneristi Probably going to have to change where were fetching these deps from in the build process because JCenter and Bintray aren’t working.

@louniss I can’t find any resources that state JCenter and Bintray being shutdown today? I found something that mentions being shutdown Feb 1st 2022, but were now way past that date