Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cause: error in opening zip file (android-studio)

When I create a new project I finish the steps and click on "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't solve this problem.

like image 557
Mr Ahemd Mamdouh Avatar asked Dec 05 '13 11:12

Mr Ahemd Mamdouh


3 Answers

My Installation & problem details

I had this issue after importing a github project into Android Studio using the File > Import Project option. Network was fine and I had other Android Studio projects working properly so this was not a installation issue. I run Android Studio (Preview) 0.5.4

enter image description here

The solution that worked for me

I had the luxury of comparing differences with working projects. That is how I discovered the error was due to the distributionUrl property in the gradle/wrapper/gradle-wrapper.properties file.

In the failing project this was set like distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip. While in the working project this was distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip. Note the difference in the version.

Updating this distributionUrl in gradle-wrapper.properties to this 1.11 link solved the issue for me.

About the Network

I have this issue on a very restricted network and I can see that the gradle-1.10 link does point to a zip file. The network issue sounds very plausible to. Probably I already have the 1.11 zip downloaded while on another network. I's less likely (though not impossible) that the 1.10 zip is broken.

like image 151
hcpl Avatar answered Oct 13 '22 19:10

hcpl


Android Studio error installing Gradle

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

Note: ~/.gradle/ is where the directory may be found on unixoid operating systems (e.g. Linux, OS X, ...). On Windows it's typically at C:/Users/[NAME]/.gradle/.

like image 28
jerry Avatar answered Oct 13 '22 19:10

jerry


You can erase the existing gradle zip file, then download the appropriate one from Link https://gradle.org/releases/, and copy the new one (basically replace the existing one, mine was cc 5 MB, with new one cc 80 MB). Then reload Studio, and wait.

like image 1
user9380860 Avatar answered Oct 13 '22 20:10

user9380860