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.
- Just Move
mavenCentral()
abovejcenter()
in build.gradle file. - Then clean/build on your project.
- Now you can comment out
jcenter()
. - Now mavenCentral() becomes the primary repository for all non Google artifacts.
- 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.
- For koin, change the group id from
org.koin
toio.insert-koin
– the latter is published on maven central. - 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