Search code examples
androidandroid-studiomavenwarningsjcenter

JCenter Maven repository is no longer receiving updates: newer library versions may be available elsewhere


I am getting this warning in project level build.gradle file in android studio.

Warning:(22, 9) JCenter Maven repository is no longer receiving updates: newer library versions may be available elsewhere

What is supposed to be done. I tried removing it and got a long list of errors as below.

> Could not resolve all files for configuration ':classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.7.10/kotlin-stdlib-jdk8-1.7.10.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > com.android.tools.build:gradle:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:gradle-settings-api:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools:sdk-common:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools:repository:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:aaptcompiler:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.analytics-library:shared:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.lint:lint-model:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > androidx.databinding:databinding-compiler-common:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:builder:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:builder-model:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:gradle-api:7.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools:sdk-common:30.4.2 > com.android.tools:common:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:builder:7.4.2 > com.android.tools.analytics-library:tracker:30.4.2
         project : > com.android.tools.build:gradle:7.4.2 > com.android.tools.build:builder:7.4.2 > com.android.tools.build:manifest-merger:30.4.2
   > Could not find org.apache.httpcomponents:httpmime:4.5.6.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.....

And the possible solution is given as follows:

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

What shall I do to remove the warning?

This is my project level build.gradle, where I am getting the warning:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.2'
        classpath 'com.google.gms:google-services:4.3.15'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

Solution

  • Resolved: To remove this warning replace:

    buildscript {
    
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:7.4.2'
            classpath 'com.google.gms:google-services:4.3.15'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    

    with

    buildscript {
    
        repositories {
            google()
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:7.4.2'
            classpath 'com.google.gms:google-services:4.3.15'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            mavenCentral()
        }
    }