导入demo时会经常遇到这些报错,如:
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)
原因:问题出在gradle-wrapper.properties上,出现这个问题的项目都是应为使用了gradle-3.3-all.zip,而studio 无法直接下载gradle-3.3-all.zip导致
处理方法:把gradle-wrapper.properties里gradle的版本改为
https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
,再去重新build,这样就好了!
参考地址:
http://www.jcodecraeer.com/a/anzhuokaifa/Android_Studio/2017/0317/7691.html