android-studioandroid-studio-2.2android-studio-2.1

Android Studio: Gradle sync failed: Connection timed out: connect


My Android Studio was working fine till morning, but since tonight I get error saying "Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.". I am not using any proxy server. Even the option for HTTP proxy is set to "no proxy". I have no idea how to get this working. I tried giving public access to Android Studio in firewall but it didn't work.

Any help/solution is welcome.

P.S. My Android Studio version is 2.2.3

Thank you!


Solution

  • I think it's a network issue. My project currently fails to build unless I pass the --offline argument to gradle. I think the S3 outage is impacting repos hosting dependencies.

    Try ./gradlew tasks --offline

    Or, to make android studio run in offline mode, follow the instructions: https://stackoverflow.com/a/32173577/1043518