我遇到了无法解决的这个 android 项目的问题。首先,我尝试将 jCenter() 更改为 maveCentral(),但这仍然不起作用。
这是错误:
A problem occurred configuring root project .
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30-release-412.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.30-release-412/kotlin-gradle-plugin-1.5.30-release-412.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.30-release-412/kotlin-gradle-plugin-1.5.30-release-412.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
这是gradle文件:
buildscript {
ext.kotlin_version = "1.5.30-release-412"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0-beta03"
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 {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}