[英]React-Native: ''Please remove usages of `jcenter()` Maven repository from your build scripts...''
[英]Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life
在 Android Studio 4.2 中有一个警告:
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()
那么它找不到我的应用程序项目的一些依赖项:
> 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()
将mavenCentral()
jcenter()
。
对您的项目进行清理/构建。
注释掉jcenter()
通过将 mavenCentral() 移到mavenCentral()
上方, jcenter()
mavenCentral()
现在成为所有非 Google 工件的主要存储库。 通过进行清理和构建,所有工件现在都移至mavenCentral()
。
我不得不查找并尝试了它。 在我删除jcenter()
之后,我彻底摆脱了束缚,从而能够再次为学校构建我的最终项目。
对于 koin,将组 id 从org.koin
更改为io.insert-koin
- 后者发布在 maven 中央。
对于 chartboost,您可以使用以下 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 存储库中重新发布。
mvnrepository是一个很好的定位包的服务。
只是注释掉 jcenter() 会有所帮助,mavencentral() 已经在 jcenter 之上。
在项目文件夹树中找到所有build.gradle
文件,打开它们并将jcenter()
替换为mavenCentral()
。 大多数时候它对我有用。
希望这会有所帮助
jcenter()
。这是以前的样子。
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
之后。
buildscript {
repositories {
google()
mavencentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
mavencentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
所以这里有两个问题。
首先,我们需要在所有项目中将 MavenCentral 移到 jCenter 之上
二、Android构建工具版本需要升级到4.2.0及以上。 由于 Android 内部构建工具依赖项将转到 jCenter
依赖项{类路径(“com.android.tools.build:gradle:4.2.0”)}
它应该工作
这可能会帮助某人。
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
...
}
}
我用它来解决:
> Could not find com.github.parse-community.Parse-SDK-Android:parse:1.26.0.
Required by:
project :app
我遇到了同样的错误,当我使用 Android Studio Artic Fox Beta - 3
但在将 Android Studio 更改为Canary Build
之后,错误消失了
我所做的解决方案是更改 build:gradle 版本:
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
解决方案很简单,只需找到build.gradle并将jcenter()替换为mavenCentral() 。
祝你好运
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.