Gradle's dependency cache may be corrupt (this

2019-03-05 12:23发布

问题:

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

I got this issue after updating the android plugin.

Please help.

I tried to change the gradle version to 4.6(distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip) and its working too, but I want to use the recommended gradle-4.10.1 (distributionUrl=https://services.gradle.org/distributions/gradle-4.10.1-all.zip) version.

回答1:

Well I resolved the issue.

Remove the ~/.gradle/wrapper/dists/gradle-4.10.1-all folder and then rebuild the project in android studio.

rm -rf ~/.gradle/wrapper/dists/gradle-4.10.1-all

This removes the corrupted or partially downloaded gradle-4.10.1-all.

This is working for me.