Android studio 4.2 环境配置 gradle project sync failed 暂时解决方法

本文介绍了解决新工程中gradle项目同步失败,因找不到kotlin-gradle-plugin 1.5.0-release-764版本的问题,通过删除不正确的版本后缀并更新为1.5.0成功解决的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

new工程的时候遇到 gradle project sync failed.

build 显示 Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.

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

测试后发现不是gradle的问题,复制pom的URL到浏览器发现无法打开网页,换maven源也无法解决

应该是kotlin版本号有问题,正常的版本号不会带后缀。

 

解决办法:

打开build.gradle文件,找到kotlin的版本号

ext.kotlin_version = "1.5.0-release-764"

删除后缀,修改为1.5.0

    ext.kotlin_version = "1.5.0"

点击 try again

搞定。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值