Skip to content Skip to sidebar Skip to footer

Android Studio Error Error:connection Timed Out

I just create a new Project in the android studio and add gcm module to it. and I keep giving this error message Error:Connection timed out: connect. If you are behind an HT

Solution 1:

Just try Invalidate Caches.. Goto File->Invalidate Caches/Restart->Choose "Invalidate and Restart".

Solution 2:

The answer from this SO post might help you.

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=8080systemProp.https.proxyUser=userid
    systemProp.https.proxyPassword=password
    systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

Solution 3:

If you encounter these errors even without proxy or if you have downloaded a source code and unable to compile it, follow these steps:

1- Create another empty project

2- Go to File\Project Structure\project and take note Gradle Version and Android Plugin Version

3- go back to the Troubled project and use same Versions in previous path. sometimes needed to change both jcenter to mavenCentral too

4- in the Project Structure Window go app\properties and change Compile Sdk Version to Latest Version.

5- I recommend change the Target Sdk Version to latest version too (in the Flavors tab)

6- Sync, Clean and Rebuild project.

Now, the problem with gradle compiler is resolved, You may encounter with some errors about dependencies. These problems usually resolve with updating dependencies. for update dependencies to latest version use this guide provided by @Jared Kells

Solution 4:

If you are on Win7, then your Firewall blocks Android studio from connecting. You will have to add android studio to the trusted files and bingo! everything will start working!!

Solution 5:

I solved the issue by

file -> settings -> search for proxy -> changed from noProxy to use proxy and provided company given proxy

Post a Comment for "Android Studio Error Error:connection Timed Out"