close

[Solved] Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life

Hello Guys, How are you all? Hope You all Are Fine. Today when I update my Android studio to version 4.2 then I found the following error Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life in Android Studio. So Here I am Explain to you all the possible solutions here.

Without Wasting your time, Lets start This Article to Solve This Error.

How Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life Error Occurs ?

Today when I update my Android studio to version 4.2 then I found the following error Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life.

Here is my gradle.build file

buildscript {
    ext.kotlin_version = '1.5.0'

    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

When I removed jcenter() from build.gradle I found another error

   > Could not find org.koin:koin-core:2.0.1.
     Required by:
         project :app
   > Could not find org.koin:koin-androidx-scope:2.0.1.
     Required by:
         project :app
   > Could not find org.koin:koin-androidx-viewmodel:2.0.1.
     Required by:
         project :app
   > Could not find com.google.ads.mediation:chartboost:8.1.0.0.
     Required by:
         project :app

How To Solve Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life Error ?

Question: How To Solve Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life Error ?
Answer: If you want to solve first error then just Move mavenCentral() above jcenter(). and then do a clean/build on your project. now you can comment out jcenter(). By moving mavenCentral() above jcenter()mavenCentral() now becomes the primary repository for all non-Google artifacts. By doing a clean and build, all artifacts are now moved to mavenCentral().

Solution 1

If you want to solve first error then just Move mavenCentral() above jcenter(). and then do a clean/build on your project. now you can comment out jcenter(). By moving mavenCentral() above jcenter()mavenCentral() now becomes the primary repository for all non-Google artifacts. By doing a clean and build, all artifacts are now moved to mavenCentral(). Follow below steps.

  1. Just Move mavenCentral() above jcenter() in build.gradle file.
  2. Then clean/build on your project.
  3. Now you can comment out jcenter().
  4. Now mavenCentral() becomes the primary repository for all non Google artifacts.
  5. By doing a clean and build, all artifacts are now moved to mavenCentral().

Solution 2

To solve Could not find org.koin:koin-core:2.0.1. this error just follow below steps.

  1. For koin, change the group id from org.koin to io.insert-koin – the latter is published on maven central.
  2. For chartboost, you can use the following repo:
maven {
    url "https://dl.bintray.com/google/mobile-ads-adapters-android/"
}

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read: SyntaxError: invalid syntax to repo init in the AOSP code

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment