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)
当报这种错的时候
解决方案尝试:
1.乍一看,以为是没有网,保证网络连接后重新download,发现还是报同样的错。
2.既然说打开zip文件失败,那我查看gradle-wrapper.properties,那我去gradle目录找到项目依赖的4.10.1-all.zip,手动解压,提示压缩文件损坏
呐,找到问题点,删除现有的4.10.1-all.zip,保证网络状况,重新构建,问题解决
复盘:对as报的错没有深入分析,其实Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)的字面意思已经写的很清楚,可能因为下载gradle过程中,网络链接不稳定,导致gradle依赖的缓存损坏,导致zip无法被打开
错误:无法打开zip文件。Gradle的依赖缓存可能已损坏(这有时发生在网络连接超时之后。)