Error:Failed to open zip file. Gradle's dependency cache may be corrupt

来源:互联网 发布:linux的ftp权限设置 编辑:程序博客网 时间:2024/05/22 12:38

在使用AndroidStudio直接导入GitHub中的源码过程中,AS出现了某个过程感觉十几分钟了,其实代码已经从GitHub中拉下来了,应该是AS执行项目配置时出了问题,遂直接结束了AS的进程;
从新打开AS时,Sync Gradle报错:

Error: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)

仔细研究错误应该是GradleWrapper出了问题,此Github项目使用的是gradle-3.4.1,本地没有这个版本的缓存,于是AS自动从网络下载,之前导入时AS有个过程执行慢,是因为其在下载慢。(其实手动下载会快点儿)

查看目录
~/.gradle/wrapper/dists/gradle-3.4.1-all/
目录下的zip文件大小才不到十兆,肯定没有下载完,所以才报无法open zip file;

删除gradle-3.4.1-all目录,从新打开AS就不会报错了,但是会从新自动下载。。开始慢的话只能手动下载了。

阅读全文
0 0
原创粉丝点击