React-Native: ''Please remove usages of `jcenter()` Maven repository from your build scripts...''

Viewed 1994

I'm build my project after added react-native-image-crop-picker. But i meet this error. enter image description here Could you please to show me the way to fix this. Thank you very much.

//build.gradle
buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
    }
    repositories {
        
        mavenCentral()
        google()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.1")
    }
}

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://maven.google.com' }
        maven { url 'https://www.jitpack.io' }
    }
}
1 Answers

try this to migrate from jCenter to mavenCentral

enter image description here

Related