8

I changed the version of gradle of Android Studio 1.5.1 from 1.5 to 2.10 and clicked sync now, (error image) but the follow ERROR ocurred :

Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

peak
  • 105,803
  • 17
  • 152
  • 177
Ahmadreza_HK
  • 364
  • 1
  • 5
  • 10
  • although ans is same but you can also check this link [http://stackoverflow.com/a/37807663/2507782](http://stackoverflow.com/a/37807663/2507782) – Rahul Sonone Jun 14 '16 at 09:15

2 Answers2

14

go to your gradle.properties file in gradle scripts and add this :

systemProp.http.proxyHost=127.0.0.1

systemProp.http.proxyPort=3128 // enter your proxy port

systemProp.https.proxyHost=127.0.0.1

systemProp.https.proxyPort=3128 // enter your proxy port.

You can find proxy port by going to internet option-> connections -> LAN settings -> Advanced -> port

Iman Marashi
  • 5,593
  • 38
  • 51
Abolfazl Miadian
  • 3,099
  • 2
  • 19
  • 15
1

Incase you are still experiencing this error and not using any proxy, this is the way I solved my error by navigating to :

C:\Users\AdminUser\.gradle then locate gradle.properties

deleted the code with proxy settings as below:

systemProp.http.proxyHost=proxyIP
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=proxyIP
systemProp.https.proxyPort=8080
Kamau Mbûgua
  • 777
  • 1
  • 10
  • 19