Error:Failed to open zip file. Gradle's dependency cache may be corrupt Error:Failed to open zip file. Gradle's dependency cache may be corrupt android android

Error:Failed to open zip file. Gradle's dependency cache may be corrupt


Repair Gradle Installation

This usually happens when something goes wrong in Android Studio's first launch (eg. system crash, connection loss or whatever).

To resolve this issue close Android Studio and delete the following directory's content, necessary files will be downloaded on IDE's next launch.

macOS: ~/.gradle/wrapper/dists

Linux: ~/.gradle/wrapper/dists

Windows: C:\Users\your-username\.gradle\wrapper\dists

While downloading Gradle manually works, I recommend letting Android Studio itself to do it.


UPDATE 17 JULY 2018:

Even if the following solution still works as of today,I've found (thanks to the answer posted by Hamid Asghari and to the comment posted by Mahendra Dabi) that simply deleting the gradle dist directory and performing a reboot of the ide, will fix the issue (please read Hamid post for a full answer, and remember that OSX and Linux have the same gradle path).

If you still want to follow my original solution, you should at least consider using a more up-to-date version of Gradle (direct link of the gradle distribution repo: https://services.gradle.org/distributions/)


Original answer (dated 7 March 2017):

I've faced the same issue this morning after upgrading Android Studio to 2.3.To solve the issue:

1) Manually download Gradle 3.3 binary (direct link: https://services.gradle.org/distributions/gradle-3.3-bin.zip)

2) Open your android studio root directory, and extract the zip to the gradle folder (for example in my Debian machine the full path is /opt/android-studio/gradle/gradle-3.3)

3) Open Android Studio, go to File->Settings->Build, Exectution, Deployment->Gradle and set "Gradle home" to point your new gradle-3.3 folder.

4) Sync and you are ready to go!


I faced the same issue 2 days ago and today I was able to solve it like this:

  1. Go to this path C:\Users\user_name\.gradle\wrapper\dists where user_name is your username if its you own PC or your company's name.

  2. Delete the latest gradle-****-all files since your latest update of android studio (ex. 2.3 or another version).

  3. If your android studio is open, close it then reopen it. A newer Gradle version will be downloaded, it will take time depending on your internet speed, the download size is around 150-200 MB before extraction so if android studio takes a long time to refresh just know its downloading. (To check the download progress right click on the new gradle folder, go to properties and check the size).