Android Studio日常抽风(Failed to open zip file.)

Android Studio日常抽风(Failed to open zip file.)_第1张图片

错误信息如下:

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)

路径是在C盘C:/Users/你的用户名/.gradle/wrapper/dists/里面

Android Studio日常抽风(Failed to open zip file.)_第2张图片

以gradle-3.3-all为例,进入gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/,你会发现有一个gradle-3.3-all.zip,当然也有可能没有,android studio里的错误信息Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)可以理解为中间的的zip文件损坏或者不完整,在Gradle官网里重新手动下载一个相应版本的将其替换即可。这里给出网址:https://gradle.org/releases/点击打开链接

随后打开Android Studio,将Android Studio的项目结构由原来的Android改为Project,找到gradle/wrapper/gradle-wrapper.properties,把

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

里面https的那个s去掉,点击Try Again,你就会发现,项目开始正常运行。


你可能感兴趣的:(Android Studio日常抽风(Failed to open zip file.))