Re-download dependencies and sync project (requires network)

最近在升级Android Studio 3.0的过程中遇到了一个问题:

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)

网上搜索了一下,有些是直接下载最新gradle包,或者删除.gradle\wrapper\dists下面的文件,不过有一个最简单的办法:

找到 'gradle-wrapper.properties' 文件

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
或者
distributionUrl=http\://services.gradle.org/distributions/gradle-4.1-all.zip
把 "https" to "http".

重新build,完美解决!

你可能感兴趣的:(Re-download dependencies and sync project (requires network))