Article From:

Android StudioAfter importing the project, Gradle compile failed, and the following error was reported.

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>

A search was made because the Gradle version specified in the file of the project does not exist. The following figure requires

In the Gradle settings of AS, the default path of Gradle Home is C:\Users\ user name \.gradle\wrapper\dists\. Take a look at this directory and find that gradle-3.5-all files do exist.Clip.

Why did it still fail to find the target version of gradle? Comparing the other versions of gradle directory, it is found that the size of is obviously smaller than that of other versions. It turned out that the GFW network in the Heavenly Kingdom led to gra.When was downloaded from the next, it was not downloaded completely. Gradle-3.5 can not be used normally.

The solution is to manually download gradle from the web site (using the downloading tool such as thunder and so on) and drop it into the C:\Users\ username \.gradle\wrappeR\dists\ can. When you download the URL address, notice HTTPS instead of HTTP (more than s).

Without unpacking the compression package, open the AS to open the project and manually modify the gradle path in to ask the local path:

After compiling the Gradle, you can see that the compression pack is decompressed. After the compilation is completed, the zip compression package can be deleted.





One Reply to “Android Studio error Error:Failed to open zip file. Gradle’s dependency cache may cache”

Leave a Reply

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