. Advertisement .
..3..
. Advertisement .
..4..
When attempting to complete your task, you receive the following error message: “Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life“.
It is one popular mistake that every programmer makes. So, what causes it to appear, and how can it be resolved? We’ll go over it with you.
Why Does The Issue “Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life” Occur?
When you update your Android studio to version 4.2 today, you make the following mistake: Please remove usages of the jcenter()
Maven repository from the build scripts / JCenter is no longer supported.
Here’s a link to the 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()
}
}
You discover another error after removing jcenter()
from the build.gradle
.
> 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
Some Fundamental Tips For ””Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life” Error
Solution 1: Follow these steps
To resolve org.koin:koin-core:2.0.1 could not be found. To correct this fault, you need to follow the steps below.
Change an org.koin group id
to io.insert-koin
for koin – the latter is authored on maven center.
You could use the next repo for chartboost:
This is your command:
maven {
url "https://dl.bintray.com/google/mobile-ads-adapters-android/"
}
Solution 2: Take the steps outlined below
The second solution for “Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life” error is taking the steps outlined below.
Immediately place mavenCentral()
above jcenter()
in the build.gradle
file.
Then proceed to clean/build on your project.
You could now comment out jcenter()
.
MavenCentral()
has now been designated the principal archive for all non-Google artifacts.
Due to a clean build, all artifacts have been moved to mavenCentral()
.
Solution 3: Add Maven Central to your project
Let’s add Maven Central into your project to make sure that OneSignal continuously get updated. This is a great way to solve “Please remove usages of jcenter()
Maven repository from your build scripts / JCenter is at end of life” error. Let’s follow the below steps to do that:
- Step 1: Access to your origin
build. gradle
and open it. - Step 2: All
Jcenter()
lines should havemavenCentral()
added before them.
(Be sure to supplement mavenCenteral()
in both places where jcenter()
is discovered).
After doing that, your build.gradle
will be as the following:
// Top-level build file where you can supplement configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral() // New line
jcenter()
// NOTE: Keep any other entries you may have had here
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
//... no changes here
}
}
allprojects {
repositories {
google()
mavenCentral() // New line
jcenter()
// NOTE: Keep any other entries you may have had here
}
}
By selecting “Sync Now” in Android Studio, you can sync Gradle.
Conclusion
For those still perplexed by this Error: “Please remove usages of jcenter() Maven repository from your build scripts / JCenter is at end of life” the solutions listed above are our most practical.
If you need assistance or have common Android Studio questions, we have a thriving community where everyone is always willing to assist. Finally, we wish you a wonderful day filled with new code solutions.
Leave a comment