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

后端 未结 15 2509
情话喂你
情话喂你 2020-12-06 04:28

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, p

相关标签:
15条回答
  • 2020-12-06 05:16

    Do not forget proxy for https in gradle.properties

    systemProp.http.proxyHost=your.proxy.host
    systemProp.http.proxyPort=8080
    systemProp.http.proxyUser=username
    systemProp.http.proxyPassword=password
    #
    # DO NOT forget https proxy, too!
    #
    systemProp.https.proxyHost=your.proxy.host
    systemProp.https.proxyPort=8080
    systemProp.https.proxyUser=username
    systemProp.https.proxyPassword=password
    
    0 讨论(0)
  • 2020-12-06 05:16

    I solved my problem by turning off my anti-virus (avast)

    0 讨论(0)
  • 2020-12-06 05:18

    I got the very same problem.

    In my case, I started my android project on campus. Everything was fine then. When came home and started using the wifi I got the same problem (Gradle sync failed: Connection timed out).

    All did is modify gradle.properties file under Gradle Scripts. I just removed the proxy settings that were stored in that file. Everything's back to normal now.

    Below is an image of where to find the file:

    0 讨论(0)
提交回复
热议问题