Reason: error opening zip file (android studio)

When I create a new project, I complete the steps and click "finish" and wait for the project to open. But instead, I see an error:

Error: Cause: error in opening zip file. Consult IDE log for more details (Help | Show Log)

I can not solve this problem.

+8
android studio
source share
7 answers

My installation information and issues

I had this problem after importing a github project into Android Studio using the File > Import Project option. The network was perfect and I had other Android Studio projects that worked properly, so this is not an installation problem. I launched Android Studio (Preview) 0.5.4

enter image description here

Solution that worked for me

I had the luxury of comparing differences with work projects. So I found that the error is related to the distributionUrl property in the gradle/wrapper/gradle-wrapper.properties .

In a failed project, this was set as distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip . In a working draft, this was distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip . Note the difference in version.

Updating this distribution of Url in gradle -wrapper.properties to this link 1.11 solved the problem for me.

About network

I have this problem on a very limited network, and I see that the gradle -1.10 link points to a zip file. The network problem sounds very believable. I probably already have a 1.11 zip downloaded on another network. I am less likely (although not excluded) that 1.10 zip is broken.

+9
source share

Installing Android Studio Gradle Error

Your situation may be like this. Just edit the right gradle -1.x.zip and replace the bad one with ~/.gradle/wrapper/dists/gradle-1.x/[hash code]/ and restart android studio

Note. ~/.gradle/ is a directory that can be found on unixoid operating systems (e.g. Linux, OS X, ...). On Windows, this is usually the case with C:/Users/[NAME]/.gradle/ .

+4
source share

You can delete the existing gradle zip file and then download the corresponding one from the link https://gradle.org/releases/ and copy the new one (basically replace the existing one, mine was cc 5 MB, with a new one cc 80 MB). Then restart Studio and wait.

+1
source share

In my case, this is caused by incorrect HTTP proxy settings. Android Studio created the gradle -1.x-bin.zip file with the HTML error page of my proxy inside. It is obvious that subsequently he will not be able to open the zip file.

The error disappeared after I configured the HTTP proxy settings in the File> Settings> HTTP Proxy section, deleted the existing archive, and restarted Android Studio.

0
source share

it can help you

Android Studio - Failed to complete gradle execution - error opening zip file

delete the .gradle directories in both the home directory and the project root directory and try creating again.

0
source share

If it says disabling offline mode, disable it by clicking on it again. It will download some necessary jar files. Then enable offline by checking the box in the gradle settings for offline work. Turn off the Internet and rebuild the project to make sure it is still working.

0
source share

I am facing this problem .... Go to the link https://gradle.org/releases/ then upload the full gradle file ..

Android Studio → Settings → build tools → gradle → Project level settings → select Use local gradle distribution

then select gradle download file

And OK .... Automatically sync gradle and solve your problem ....

0
source share

All Articles