Gradle refresh failed due to error in downloading dependies - android

I upgraded android studio to v2.3 and then while trying to update the support repositories, I lost internet connection and I can't understand what to do.
I get the following error in Messages box
Gradle 'Pets' project refresh failed
Error:Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
On one site it said to delete the file in .gradle/cache but I couldn't understand what to delete. I've tried clicking on the link to re-download dependencies but I get the same message.
Could anyone please help?
Thank you!

I solved the problem by manually downloading the zipped file from https://services.gradle.org/distributions/gradle-3.3-all.zip and then replacing the automatically downloaded zipped file in .gradle with it. Then I started Android Studio and it automatically downloaded and installed the required components.

Related

Why Android Studio again and again show ERROR: Failed to open zip file. even when i am crating a new project?

Before Updating my Android Studio it was working fine but before 2 days I had updated my studio then the problem is started.
UPDATE FROM VERSION 3.1 to 3.3
Now, It is giving me this error
ERROR: Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a
network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
It shows me error all the time when i trying to open the project in studio evenly on making new projects or importing my old projects
My error is solved when i am update my gradle wrapper class...
FROM THIS->
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
To THIS->
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
How can i solve it permanently for my future projects
1) Manually download Gradle 3.3 binary (direct link: https://downloads.gradle.org/distributions/gradle-5.2.1-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!
I hope that helps.

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

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.
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.
in this image we will show Gradle wrapper class its show about our current project Gradle version ;
C:\Users*username*.gradle\wrapper\dists
delete the dists folder
download ant GitHub project and run it
- in this case, the android studio will download necessary files.
- and Gradle files too it about 135MB size.
after successfully download run the GitHub project and after this run your local project.
yeah, the android studio will run normally.........

Error: Failed to open zip file

I just updated my Android Studio to the latest version and I am getting this error when opening a project:
Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a
network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
I tried rebuild the project but it is not working as of now. My network connection is fine. What should I do to fix this?

Unable to sync gradle in android studio 3.0.1

Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
(Re-download dependencies and sync project(Requires network)
Hello please help,
I am using android studio 3.0.1. I have active internet connection then also this problem arrive. I also did it manually i.e.in gradle folder i manuaaly added that distribution gradle-4.1-all.zip.
But it didn't worked!! please help.
Clean your project. Delete .idea and .grade folder from your project folder. Now build your project.
If still fails, try running gradlew from Terminal in Android Studio. Still fails, check your network connection and/or proxy settings.

Android studio 3.0 Gradle 'MyApplication' project refresh failed

After upgrading from version 2.7 preview 7 to 3.0 even on every new project create getting this error
Error: Failed to open the zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
As I think when the project is creating .gradle folder is created in the directory. but in my case after upgrading it's not creating. have any idea
thanks in advance
Screen Shots:
I Got solution . As i checked in my sample project all thing are settled .Only the issue is slow internet which is not able to download gradle. So i manually download it and i have to change it from (Default which i don't want)to local.

Categories

Resources