Reputation: 51
so yesterday I updated my android studio to the newest version (4.2) and after building my project I got this warning
Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: root project 'Personal Dictionary', project ':app'
so what repository should I use instead?
Upvotes: 0
Views: 1243
Reputation: 2512
To add to laalto's excellent answer, if you have a simple project you can likely replace the two instances of:
jcenter()
with
mavenCentral()
in your project's build.gradle
file. Recompile/build your project after making the changes to see if it builds successfully.
Upvotes: 0
Reputation: 152817
It depends on where your dependencies are hosted. Not all libraries are yet migrated off jcenter
yet. Generally, mavenCentral
seems to be the most popular repo.
You can comment out jcenter
in your build.gradle file, invoke gradle build with --refresh-dependencies
command line option and see if the build is failing somewhere. You can use mvnrepository service to try to find other repos for your dependencies.
If there are still dependencies that are only in jcenter, you can restrict gradle to only use that specific dependency from that repo:
jcenter() {
content {
includeModule("<group id>", "<artifact id>")
}
}
Upvotes: 1