Error:Connection timed out: connect - Android

梦想与她 提交于 2019-12-02 08:20:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!