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:
If it says asks for disable offline mode, disable it by clicking on it again. It will download some required jar files. Then enable offline mode by checking checkbox under gradle settings for offline work. Disconnect from internet and rebuild project to see if it still works.
this may help you
Android studio - Failed to complete gradle execution - error in opening zip file
delete the .gradle directories in both your home directory and in your project's root directory and try building again.
I am Facing this problem.... Go to Link https://gradle.org/releases/ then download complete gradle file ..
Android studio -> Settings -> build tools -> gradle -> Project-level settings -> select Use local gradle distribution
then select your gradle download file
And Ok....Automatically Sync Gradle and Solve Your Problem ....
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
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.
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.
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.
In my case it caused because of not properly configured HTTP proxy settings. Android Studio created the gradle-1.x-bin.zip file with the HTML error page of my proxy server inside. Obviously it won't be able to open the zip file afterwards.
The error disappeared once I configured the HTTP proxy settings under File > Settings > HTTP Proxy, deleted the existing archive and restarted Android Studio.