Feb 26, 2018 Failed to open zip file Gradle's Dependency cache may be corrupt in Android Studio.
I was trying to import this project, also I attempted to transfer other few projects too, I was obtaining below error.
I have spent my 5 hours on it, also I tried many options on search engines but nothing at all gonna proved helpful for me.
I tried following options, nothing worked well.
I feel discouraged because of this Gradle and these problems.
Be aware : My some other project is definitely working great and I can construct it as well.
Zoe15.9k99 platinum badges6262 sterling silver badges9494 bronze badges
samksamk2,97999 yellow metal badges6161 silver badges9898 bronze badges
6 Answers
You can attempt various workarounds for this issue :
1-Cleantask andRebuildit.
2-Before importing the task, remove the material of theConstructfolders.
Then substitute the material of yourgradle-wrapper.propertiesfile with the sticking with ranges, to make it use a regional submission for building the project :
in which, the last line prevents android facility to download or make use of a corrupted gradle cache.
Farhad FaghihiFarhad Faghihi6,06544 gold badges2323 silver precious metal badges4545 bronze badges
Because your gradle route for task is wrong.Go to -gt;Settings-gt;Gradle
and go for 'make use of default gradle settings'and than sync project. and concern will become solved.
Hammad TariqHammad Tariq
2,11233 gold badges1616 gold badges2323 bronze badges
In my case, it was occurring because i haven't arranged the JDK path in environment variable. Please examine from your Android studio facility that your JDK route is correct.
Proceed to Task Structuregt; SDK Place and examine JDK Path. Give it the appropriate JDK path and furthermore fixed the JAVAHOME environment shifting.
AjjiAjji
You can consider this remedy as i was dealing with this issue showing Error2 Gradle't dependency cache may become corrupt and gradle build not functioning and resolved it. Already clarified this query on bunch. You can reffer to this response link
It contains first of all downloading most recent graddle version from formal site after that replacing that unzipped file with house/yourUser/.graddle/wrapper/dists containg old version document on Macintosh.
Neighborhood♦
Ali NawazAli Nawaz
- Proceed to any web browser
- kind gradle and press enter
you can designate any version you desire after the
gradle keyword
we am installing gradle 3.3
- https://services.gradle.org/distributionsclick on this hyperlink which can be in description straight if you wish
- click on on gradle 3.3 all.go
- wait for the download to total
- once the download is usually complete get the file to the place
d://user/your pc title /.gradle/wrapper/dists
- wait till extraction it will take 5 minutes to total
- Now open up your task in android facilities
9.go to file gt; configurations gt;bulid ,exec,deployment gt; gradle
- today change use default gradle to
make use of local gradle distributn
select the place where you experienced extracted gradle 3.3.zip
G:Usersyour pc title.gradlewrapperdistsgradle-3.3
- click on on Fine
- Now build starts again and
you can find now the construct is effective and mistake is solved
or
view tutorialhttps://www.youtube.com/watch?v=u9273vfA8M
Manoj SelvinManoj Selvin
In my case is that gradle-5.1.1-all.diddly download failed, so I proceed to zipStoreBase+zipStorePath(configured in gradle-wrapper.qualities, eg: Elizabeth:gradle-homewrapperdists), and delete the gradle-5.1.1-all website directory, and let android recording studio to download that zero file once again.
Daring DolphinDaring Dolphin