您当前的位置:首页 > 计算机 > 软件应用 > 开发(IDE)

Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.

时间:02-06来源:作者:点击数:

昨天笔记本重装了系统,今天下载安装了最新的版本:Android Studio 4.2,然后创建一个新项目后就出现了异常,如下:

A problem occurred configuring root project 'HelloWorld'.
> 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

在StackOverflow上找到了答案,把项目下的build.gradle中的kotlin版本改一下即可,原来的kotlin版本如下:

buildscript {
    ext.kotlin_version = "1.5.0-release-764"
    。。。
}

改为如下即可:

buildscript {
    ext.kotlin_version = "1.5.0"
    。。。
}

此时,会提示你1.5.0版本与IDE捆绑的1.5.0-release-764版本不同(如下图),不用管它,这个版本就是没法使用的,Google公司是真粗心大意啊,搞一个不能用的版本放到这真是搞笑,在考验大家解决问题的能力呢!

在这里插入图片描述
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门