Android Studio Gradle:请从您的构建脚本中删除 `jcenter()` Maven 存储库的使用/JCenter 已结束 [英] Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life
问题描述
在 Android Studio 4.2 中有一个警告:
In Android Studio 4.2 there is a warning:
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()
}
}
如果我删除了 jcenter()
那么它就找不到我的应用项目的一些依赖项:
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
代替 jcenter()
我添加了 mavenCentral()
推荐答案
对于 koin,将组 id 从 org.koin
更改为 io.insert-koin
-后者发表在 maven central 上.
For koin, change the group id from org.koin
to io.insert-koin
- the latter is published on maven central.
对于 chartboost,您可以使用以下存储库:
For chartboost, you can use the following repo:
maven {
url "https://dl.bintray.com/google/mobile-ads-adapters-android/"
}
另请注意,还有更新的版本,例如 koin 2.2.2/3.0.1 和 chartboost 8.2.0.0.旧版本可能不会在非 jcenter 存储库中重新发布.
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 是一个很好的定位包的服务.
mvnrepository is a good service for locating packages.
这篇关于Android Studio Gradle:请从您的构建脚本中删除 `jcenter()` Maven 存储库的使用/JCenter 已结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!