java – Gradle sync failed: Cause: error in opening zip file Corrupt Dependency Cache-ThrowExceptions

Exception or error:

I am new to Android Studio and just started learning through this online course ‘Developing Android Apps’ by Udacity..The problem is that the project which I am developing keeping in line with the course “Sunshine” is failing to sync properly.

This is the message displayed in event logs.

Gradle sync failed: Cause: error in opening zip file

Full description of logs:

**2017-03-04 08:14:32,358 [  61978]   WARN - nal.AbstractExternalSystemTask - Cause: error in opening zip file 
com.intellij.openapi.externalSystem.model.ExternalSystemException: Cause: **error in opening zip file**
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$
    at com.intellij.openapi.progress.impl.CoreProgressManager$
    at com.intellij.openapi.progress.impl.CoreProgressManager$
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$
    at com.intellij.openapi.application.impl.ApplicationImpl$
    at java.util.concurrent.Executors$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
Caused by: **error in opening zip file**
    at Method)
    at org.gradle.wrapper.Install.unzip(
    at org.gradle.wrapper.Install.access$600(
    at org.gradle.wrapper.Install$
    at org.gradle.wrapper.Install$
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(
    at org.gradle.wrapper.Install.createDist(
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$
    at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$
    ... 4 more**

Can someone point me in the right direction on how to resolve this issue?

How to solve:

Simply delete the gradle folder from your home directory! i.e


where gradle-name is the distribution you have to delete. Then open android studio and open the project to sync the gradle afresh.


Caused by: error in opening zip file

This mean that a file that Gradle has downloaded has become corrupted due to somehow or some reason. This might be the download of Gradle itself (which the wrapper does) or any dependency that Gradle has downloaded to run your build.

Gradle doesn’t attempt to detect or resolve the problem, so you need to fix it manually. The solution is often to purge Gradle’s download caches and let it get fresh copies of what it needs.

To do that, delete the .gradle directories in both your home directory and in your project’s root directory and try building again.

In your case home directory is



The following is my solution.

  1. Manually download the file specified by distributionUrl which is defined in file $PROJECT/gradle/wrapper/ In my case, the line looks like:

  2. Copy the downloaded file to the path specified in the aforementioned file. In my case, the should be put into the folder:


    Since gradle has tried to download but failed, it has a broken in that folder. Simply replace the broken one with the manually downloaded.

  3. Go back to android studio and click on the hyperlinked error message. It should proceed to synchronize.


I had created a new project when this error came.
In the terminal :

cd /Users/<user>/.gradle/wrapper/dists

Here I could see that Android studio was trying to download gradle-4.6-all while I already had gradle-4.10-all(this was working for me for earlier projects).
I removed the folder
rm -r gradle-4.6-all.

In my file, I replaced distribution URL with distributionUrl=https\://
Synched my project, and it worked.



delete that gradle and install it again


Download gradle latest version from this link
Extract files in your gradle directory
now go to android studio file>setting>build>exec deployment change default gradle location to to local gradle that you downloaded
click ok and rebuild project
that will fix


the problem is that android studio/gradle doesn’t have the permission to access the files in your project folder.
to correct this go to your project folder > properties > security > edit and select full control for your current user or all of them
editing users permissions


Experienced same error in IntelliJ Ultimate 2018 and 2019.

I fixed this issue by doing this :
Download gradle using brew:
brew install gradle
Then setup gradle settings like this and resync. Pay atention to Gradle Home:
enter image description here


This error causes due to the corrupt gradle file. All you have to do is simply delete the following folder and open Android Studio. It will automatically start downloading gradle file again and it will work fine.Delete the following folder

Leave a Reply

Your email address will not be published. Required fields are marked *