5

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 HTTP proxy, please configure the proxy settings either in IDE or Gradle.      

and I do not use any proxy.
can anyone help me about this?

Update
now after rebuild my project i give this error

Error:A problem occurred configuring project ':app'.    
 A problem occurred configuring project ':backend'.
Could not resolve all dependencies for configuration ':backend:classpath'.
   Could not resolve com.google.appengine:gradle-appengine-plugin:1.9.18.
    Required by:
        PushStart:backend:unspecified
      Could not resolve com.google.appengine:gradle-appengine-plugin:1.9.18.
      Could not get resource 'https://jcenter.bintray.com/com/google/appengine/gradle-appengine-plugin/1.9.18/gradle-appengine-plugin-1.9.18.pom'.
      Could not GET 'https://jcenter.bintray.com/com/google/appengine/gradle-appengine-plugin/1.9.18/gradle-appengine-plugin-1.9.18.pom'.
      Connection to https://jcenter.bintray.com refused
6
  • Did you try invalidating caches & restarting?
    – archived
    Feb 27, 2016 at 9:01
  • Rebuild project and apply gradle again than from file menu invalidate/restart studio Feb 27, 2016 at 9:11
  • i just try invalidating caches & restarting and steel not working
    – max
    Feb 27, 2016 at 9:12
  • Did you find a solution? I am with this same issue now ...
    – allo86
    Jul 16, 2018 at 17:02
  • accepted answer was my solution
    – max
    Jul 17, 2018 at 3:54

7 Answers 7

7

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

0
6

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=8080
    systemProp.https.proxyUser=userid
    systemProp.https.proxyPassword=password
    systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
4
  • 1
    but i do not use any proxy !
    – max
    Feb 27, 2016 at 9:47
  • that was because I don't use a proxy
    – max
    Oct 21, 2016 at 12:32
  • Earlier android studio was working fine, now that i have this problem, i don't understand what should be put Feb 4, 2019 at 14:52
  • which user name and password i want to enter ? Oct 16, 2023 at 9:47
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

2

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!!

1

I solved the issue by

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

0

if you are behind proxy and your proxy is not configured in android studio, you should do below link: Error:Connection timed out: connect

and if you are configured your proxy setting or your issue is not related to proxy, you have to update your sdk handily by below path: tools>android>sdk manager>sdk tools> check any thing you need and click on OK, then your sdk become update and then click on syncrow or Try Again button.

0

one solution for this problem go to the proxy settings, File > setting > Appearance & Behavior >System Settings > HTTP Proxy or by clicking ctrl+alt+s. And set no proxy if you not use proxy or set Auto-detect proxy settings.

if it is not work fine.

you can this way go to Gradle Scripts in your project and inside that you have file with name gradle.properties(Global Properties). not go to the gradle.properties(Project Properties) file. bottom of that file you can see some proxy settings. if you not use the connection with proxy you can remove that part. if you use the proxy you should check that correct or not. ////////////////////////////////////////////////////////

file location in my way C:\Users\HP.gradle\gradle.properties

////////////////////////////////////////////////////////

systemProp.http.proxyHost=192.168.0.10
systemProp.http.proxyPort=3128
systemProp.https.proxyHost=192.168.0.10
systemProp.https.proxyPort=3128

/////////////////////////////////////////////////////////

if you use proxy keep it like this with your proxy settings

## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Wed Mar 17 08:43:50 IST 2021
systemProp.http.proxyHost=192.168.0.10
systemProp.http.proxyPort=3128
systemProp.https.proxyHost=192.168.0.10
systemProp.https.proxyPort=3128

if you not use proxy keep it like this

## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Wed Mar 17 08:43:50 IST 2021

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.