JCenter Maven 存储库不再接收更新:新的库版本可能在其他地方可用

问题描述 投票:0回答:1

我在 android studio 的项目级别 build.gradle 文件中收到此警告。

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

应该做什么。我尝试删除它并得到一长串错误,如下所示。

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

给出可能的解决方案如下:

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

我该怎么做才能消除警告?

这是我的项目级别 build.gradle,我在其中收到警告:

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()
    }
}
android android-studio maven warnings jcenter
1个回答
0
投票

已解决:要删除此警告,请替换:

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

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()
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.