问题:
Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
原因:
gradle- 4.1-all下载下来后,解压失败,可能是下载过程中出现了问题。
解决办法:
首先打开
gradle-wrapper.properties文件,如图
然后可以看到下载地址:
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.1-all.zip
下载成功后(有转义符\,记得复制到浏览器时要去掉),打开C:\Users\Administrator\.gradle\wrapper\dists\gradle- 4.1-all\bzyivzo6n839fup2jbap0tjew文件夹,然后覆盖,解压。
rebuild project即可。