Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life

52,665

Solution 1

For koin, change the group id from org.koin to io.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/"
}

Also note that there are newer versions such as koin 2.2.2 / 3.0.1 and chartboost 8.2.0.0. Older versions are likely not republished in non-jcenter repos.

mvnrepository is a good service for locating packages.

Solution 2

Move mavenCentral() above jcenter().

do a clean/build on your project.

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().

I had to look this up and tried it. I went from all heck breaking loose after I removed jcenter() to being able to build my final project for school again.

Solution 3

just commenting out jcenter() will help, mavencentral() is already above jcenter.

Solution 4

Locate all build.gradle files in your project folder tree, open them and replace jcenter() by mavenCentral(). It works for me most of the time.

Solution 5

It is interesting that the AndroidStudio project template still adds the ref to jcenter() to gradle, but then as soon as the project attempts to build it requests that you remove it.

I just delete it from the gradle file and then it works.

remove jcenter()

Share:
52,665

Related videos on Youtube

user924
Author by

user924

Updated on July 09, 2022

Comments

  • user924
    user924 almost 2 years

    In Android Studio 4.2 there is a warning:

    enter image description here

    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()
        }
    }
    

    If I remove jcenter() then it can't find some dependencies of my app project:

       > 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
    

    In replace of jcenter() I added mavenCentral()

    • J Fabian Meier
      J Fabian Meier about 3 years
      I guess you need to check the homepages of the different missing JARs to see where you might get them in the future.
  • just_user
    just_user about 3 years
    The question wasn't how to remove it.
  • raddevus
    raddevus about 3 years
    FYI - As of 2021-06-22, mine had mavenCentral() above jcenter() but now it warns you that you have to remove it. I removed jcenter() and rebuilt and all is well now.
  • programandoconro
    programandoconro over 2 years
    After commenting jcenter clean the project.