Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) android android

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)


I updated my Android Studio to 2.3 and it asked me to update my gradle plugin to 3.3 that created issues with my running projects. I've gone through all the Stack solutions and nothing worked for me except this workaround:I changed my distribution url in gradle-wrapper.properties with this one.

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

(permanent link list here : https://services.gradle.org/distributions/)

My project is up and running.It just asked me to update to gradle build tools 25.0.0 which I did so. Everything is fine now :)

  1. Go to the project section and select gradle scripts menu.
  2. Under script, menu select gradle -wrapper.properties
  3. Then replace the distributionUrl=https://services.gradle.org/distributions/gradle-2.2-all.zip with "distributionUrl=https://services.gradle.org/distributions/gradle-3.4.1-all.zip"

enter image description herenote: distributions gradle will change depended upon the version of the android studio.


Make sure you have Internet Connection then:

1.For Window Users Go to > C:\Users\username\.gradle\wrapper\dists

2.For Linux usersGo to $HOME/.gradle (~/.gradle) and/or (Under Specific project) <PROJECT_DIR>/.gradle

3.Delete the gradle file(s) with the problem(i.e the zipped folders with missing with no its extracted file )

4.Sync the project with gradle files.


Delete corrupt files

This error occurs when Gradle files are not completely downloaded or corrupted by some other reason, so we have to redownload the files.The easy way is to delete the old files in

C:\Users\username.gradle\wrapper\dists

and rebuild the project, Android Studio will automatically download the new files.