问题
So I just installed Android studio and ran the "Hello World" basic app.
I then got this error:
Error:Connection timed out: connect
I tried deleting the gradle from my USER folder (Doesnt help).
Any help is highly appreciated. Thanks!
回答1:
Change the proxy settings in android studio to manual proxy and enter the company proxy. That helped me.
File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy -> check Manual proxy configurations. Enter the proxy -> click apply
Note** Check the connection after entering the manual proxy by clicking on Check Connection.
回答2:
You should add the below lines in the gradle.properties file for the https setings configuration
systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
来源:https://stackoverflow.com/questions/44266067/errorconnection-timed-out-connect-android