Failed to import new Gradle project: failed to install Gradle distribution with 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'

When I create a project in Android Studio, I get the following 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 the [gradle site] ( http://services.gradle.org /distributions/gradle-1.6-bin.zip) to download gradle manually, it could not load (timeout).

I cannot load gradle manually, and I cannot create a new project in android studio.

I checked everywhere before I sent this message without any luck.

My environment:

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

I have an excellent internet connection and I also tried from different networks, but I get the same error message.

Any help is appreciated.

+4
source share
3 answers

Thanks, I already solved this problem. The reason for this error is really amazing. If you try to download Gradle using a 3G connection, it will always fail, at least in my case. When I connect to the DSL connection, Android Studio immediately starts loading Gradle without any problems, and I can create a new project. Now, even if I go back to the 3G connection, it still works. To reproduce my scenario, try downloading Gradle using a 3G connection or installing a new installation of Android Studio using a 3G connection. Hope this helps someone.

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

+3
source

Try to start, as the administrator also resolves the Gradle load lock issue.

+2
source

This problem may occur due to an incorrect HTTP proxy. You can configure a proxy server in Idea.

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

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

If you try to import the project again, it will work well.

+1
source

Source: https://habr.com/ru/post/1485396/


All Articles