Android Studio日常抽风(Failed to open zip file.)

错误信息如下:

Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)

路径是在C盘C:/Users/你的用户名/.gradle/wrapper/dists/里面


以gradle-3.3-all为例,进入gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/,你会发现有一个gradle-3.3-all.zip,当然也有可能没有,android studio里的错误信息Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)可以理解为中间的的zip文件损坏或者不完整,在Gradle官网里重新手动下载一个相应版本的将其替换即可。这里给出网址:https://gradle.org/releases/点击打开链接

随后打开Android Studio,将Android Studio的项目结构由原来的Android改为Project,找到gradle/wrapper/gradle-wrapper.properties,把

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

里面https的那个s去掉,点击Try Again,你就会发现,项目开始正常运行。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值