5
votes

When creating project in Android Studio, I am getting the below error message.

Failed to import new Gradle project: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
java.net.ConnectException: Connection timed out: connect
**Connection timed out: connect

Even when I go to [gradle website](http://services.gradle.org /distributions/gradle-1.6-bin.zip) to download gradle manually, it failed to download (timed out).

I cannot download gradle manually and I cannot create new project in android studio.

I checked everywhere before I posted this message with no luck.

My environment:

  • Windows 7 64 bit.
  • java jdk1.7.0_21 64 bit.

I have excellent internet connection, and I also tried from different network, still I am getting the same error message.

Any help is appreciated.

3
It works for me. Did you try to set proxy in android studio?pepuch
Thank you, I have resolved this issue.dhamen12
This question was asked before and may solve part of the problem stackoverflow.com/questions/16585869/…Sana

3 Answers

3
votes

Thank you, I have resolved this problem already. The cause of this error is really surprising. If you try to download Gradle using 3G connection, it will always fail, that is at least in my case. When I connect using DSL connection Android Studio directly start to download Gradle with no problem and I am able to create new project. Now even if I switch back to 3G connection it is still working. So to replicate my scenario, try to download Gradle using 3G connection or install brand new Android Studio installation using 3G connection. I hope this will help someone.

NOTE: My 3G connection speed is better than my DSL connection.

2
votes

Try running as Administrator also resolve issue of Gradle downloading getting blocked

1
votes

This problem can happen because of http proxy that is incorrect. You can configure proxy in Idea.

There is another way, to download zip file from browser and put it in

C:\Users\[user_name]\.gradle\wrapper\dists\gradle-[version]\7qd8qq8te5j4f5q9aaei3gh3lj

When you try to import project again it will run well.