Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Gradle's dependency cache may be corrupt" error after updating android studio from 2.2.3 to 2.3?

Tags:

android

enter image description here

> Error:Failed to open zip file. Gradle's dependency cache may be
> corrupt (this sometimes occurs after a network connection timeout.) <a
> href="syncProject">Re-download dependencies and sync project (requires
> network)</a> <a href="syncProject">Re-download dependencies and sync
> project (requires network)</a>
like image 831
Khaled Mohsen Avatar asked Mar 04 '17 12:03

Khaled Mohsen


3 Answers

Find 'gradle-wrapper.properties' in root project

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

Change "https" to "http".

pls see the picture.enter image description here

like image 132
Eric MaCarthy Avatar answered Oct 23 '22 06:10

Eric MaCarthy


go to the "home.gradle\wrapper\dists" folder and cut/delete the "gradle-3.3-all" folder, now rebulid the project. This should resolve the issue, as it worked for me.

like image 14
Muhammad Omer Fayyaz Avatar answered Oct 23 '22 06:10

Muhammad Omer Fayyaz


I face this problem after updating Android Studio from 2.2.3 to 2.3;

Solution

1) In your project open 'gradle-wrapper.properties', change the 'distributionUrl' value

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

2) In you project open the project's 'build.gradle' file, and change the classpath

        classpath 'com.android.tools.build:gradle:2.3.0'

3) At last Sync your project.

(This is the latest gradle setting.)

like image 6
Sankar Behera Avatar answered Oct 23 '22 07:10

Sankar Behera