gradle
升级到 7.0.0-alpha10
时,工具提示jcenter 要被停止服务了,改用mavenCentral
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: Gradle Settings
Remove JCenter from repositories
根据提示,找到官方公告链接
JCenter deprecation and end of service
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
删除jcenter, 编译报错:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-collections-immutable-jvm/0.3.3/kotlinx-collections-immutable-jvm-0.3.3.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-collections-immutable-jvm/0.3.3/kotlinx-collections-immutable-jvm-0.3.3.pom
Required by:
project :app > androidx.compose.ui:ui:1.0.0-beta01 > androidx.compose.runtime:runtime:1.0.0-beta01
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
增加maven
repositories {
google()
mavenCentral()
maven { url 'https://kotlin.bintray.com/kotlinx' }
}
bintray已停, 可用aliyun maven
allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/google/'
}
maven {
url 'https://maven.aliyun.com/repository/central/'
}
mavenLocal()
mavenCentral()
}
}