最近將AS升級(jí)至2.3之后,新建項(xiàng)目遇到了如下問(wèn)題: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)
網(wǎng)上說(shuō)多點(diǎn)幾次Re-download就能解決問(wèn)題,我這不行,改gradle-wrapper.properties中的distributionUrl依然無(wú)果之后,終于找到了解決辦法:
1.手動(dòng)下載Gradle 3.3(下載地址:https://services.gradle.org/distributions/gradle-3.3-bin.zip)
2.打開(kāi)AS的根目錄,將zip解壓到Gradle文件夾里面(比如說(shuō)我得是在 E:\Android\Android Studio\gradle)

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?解壓之后如上圖
3.打開(kāi)AS,一次點(diǎn)擊File->Settings->Build, Exectution, Deployment->Gradle,在彈出窗口內(nèi)選擇Use local Gradle Distribution,路徑指向你新下載的Gradle 3.3文件夾,Apply.

4.Sync 以下項(xiàng)目,大功告成。
本人菜鳥(niǎo)一枚,初次發(fā)帖,多多指教,希望對(duì)猿友們有所幫助。祝好!