首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到kotlin-gradle-plugin

找不到kotlin-gradle-plugin
EN

Stack Overflow用户
提问于 2021-11-09 23:25:39
回答 1查看 74关注 0票数 0

我在这个android项目上遇到了问题,无法解决。首先,我尝试将jCenter()改为maveCentral(),但是仍然不起作用。

下面是错误:

代码语言:javascript
复制
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文件:

代码语言:javascript
复制
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
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-10 03:00:29

我在Maven Repo上查了一下,似乎1.5.30-release-412并不存在,也许你可以考虑使用其他版本,也许1.5.30

代码语言:javascript
复制
buildscript {
    ext.kotlin_version = "1.5.30"
    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
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69906285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档