最近将AS升级至2.3之后,新建项目遇到了如下问题: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)
网上说多点几次Re-download就能解决问题,我这不行,改gradle-wrapper.properties中的distributionUrl依然无果之后,终于找到了解决办法:
1.手动下载Gradle 3.3(下载地址:https://services.gradle.org/distributions/gradle-3.3-bin.zip)
2.打开AS的根目录,将zip解压到Gradle文件夹里面(比如说我得是在 E:\Android\Android Studio\gradle)
解压之后如上图
3.打开AS,一次点击File->Settings->Build, Exectution, Deployment->Gradle,在弹出窗口内选择Use local Gradle Distribution,路径指向你新下载的Gradle 3.3文件夹,Apply.
4.Sync 以下项目,大功告成。
本人菜鸟一枚,初次发帖,多多指教,希望对猿友们有所帮助。祝好!