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

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!

Failed to open .zip Gradle Cache May be corrupt error

  • Download the latest gradle package from this directory
  • Extract it and put it somewhere (for example f:\gradle-1.10)
  • Go to your Android Studio and load your project then open File->Settings->gradle, in this page click on Use local gradle distribution.
  • Type your gradle folder address there.

Sample Image

failed to open zip file gradle dependency cache may be corrupt

Delete wrapper folder in the gradle from the project directory.

Error:Failed to open zip file. Gradle dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

I faced the same issue when I updated my android studio to 2.2.3 from 2.1. After a while of struggling, went project->right click -> open module settings->project

1) Gradle : 2.14.1

2) Android plugin version : 2.2.3

3) Android plugin repository : jcenter

4) Default library repository : jcenter

Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

I tried many listed options in various posts but at the end reinstalling android studio worked for me. I recommend doing this option when nothing else works. I followed this post to do so.

Android studio Gradle's dependency cache may be corrupt, not loading

Be sure that you are connected to the network.

Then open Android Studio and execute a clean and a rebuild task.

Try syncing gradle using the refresh button located at the top-right of the window more than once time, retry to invalidate cache/restart.

Be sure you added google() and maven() in your repositories -> build.gradle (project level).

If any of that tasks succeded try to delete your .android hidden folder, located at your installation path.

UPDATE:
Try to go in your .gradle hidden folder then navigate to wrapper folder and delete the dists folder. Then restarts your ide.

You can refer to this question for more details: Error:Failed to open zip file. Gradle's dependency cache may be corrupt



Related Topics



Leave a reply



Submit