gradle Android Studio:无法解析配置“:classpath”的所有工件

nnvyjq4y  于 2023-01-05  发布在  Android
关注(0)|答案(3)|浏览(205)

我在Android Studio中创建了一个新项目,然后弹出了一个错误:

A problem occurred configuring root project 'About Me'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

13z8s7eq

13z8s7eq1#

试试这个:

ext.kotlin_version = "1.5.0"
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath "com.android.tools.build:gradle:4.2.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

看起来服务器端有一些问题,只需将kotlin版本更改为1.5.0,而不是1.5.0-release-764

wfsdck30

wfsdck302#

试试这个:-

repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath "com.android.tools.build:gradle:4.2.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

希望这是你的答案访问这个答案https://stackoverflow.com/a/75005827/12748481

w8rqjzmb

w8rqjzmb3#

我只是关闭了项目,并重新启动它,错误消失了

相关问题