首页 > 解决方案 > 在 android 中从 jcenter() 迁移到 mavelCentral() 问题

问题描述

如您所知,Jfrog 将要关闭jcenter(),我们必须从jcenter()提到mavencentral()android 文档迁移到。

我做到了,但在构建项目后,我收到以下错误:

Could not find com.android.tools.build:gradle:4.1.3
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom

当您单击链接时,您会收到 404 错误

这是我的project levelbuild.gradle 文件:

buildscript {
ext.kotlin_version = "1.3.72"
repositories {
    mavenCentral()
    google()
}
dependencies {
    classpath "com.android.tools.build:gradle:4.1.3"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

 allprojects {
    repositories {
       mavenCentral()
       google()
   }
 }
 task clean(type: Delete) {
    delete rootProject.buildDir
 }

有什么解决办法吗?

标签: androidgradlejcentermaven-central

解决方案


推荐阅读