Reputation: 63
Error:Failed to open zip file. Gradle dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
}
Upvotes: 4
Views: 19950
Reputation: 61
Hard and fast solution for MacOS (and possibly Linux)
The last step should download all gradle dependencies again.
Upvotes: 0
Reputation: 5889
(From my answer at https://stackoverflow.com/a/43801113/7120475)
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
Windows: C:\Users\your-username\.gradle\wrapper\dists
While downloading Gradle manually works, I recommend letting Android Studio itself to do it.
Upvotes: 6
Reputation: 86
Hey not necessary to set gradle manually. i have also faced this issue but i deleted all files in gradle folder path "C:/Users/username/.gradle/" simple steps follow
*Make sure you your gradle settings like this - checked "Use default gradle wrapper(recommended) - unchecked offline work
Upvotes: 1
Reputation:
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
Upvotes: 15
Reputation: 1119
Mine worked after I added my NDK path in Android Studio.
File -> Project Structure -> SDK Location -> Android NDK Location
Upvotes: 0