Gradle sync failed: Connection refused

后端 未结 29 2842
小鲜肉
小鲜肉 2020-11-29 10:14

So I just installed Android Studio again after a long time and it asked me to configure the proxy, so I did. I tested the connection and it worked.

Then it asked me

相关标签:
29条回答
  • 2020-11-29 10:35

    I had the same problem recently. I had my proxy setup OK but grandle could not update. After a few attempts a noticed that the "use https proxy" check button was not selected. I noticed that on the https proxy dialog which pops up while Android Studio starts.

    Keep in mind that you might cant see the https setup from File-> Settings-> HTTP Proxy, so it is important to do it using the pop-up proxy dialog on Android Studio start. You also may have the https form filled up, but you need to select that checkbox as well (at least that worked for me).

    So here are the steps I follow :

     1. Invalidate Caches / Restart     
     2. Close any project opens by default on AS start up    
     3. Select "Use **https** proxy on proxy dialog
    
    0 讨论(0)
  • 2020-11-29 10:35

    If there is VPN running on your computer you might have to turn it off.

    0 讨论(0)
  • 2020-11-29 10:38

    In my case, I verified that in File > Settings> HTTP proxy, I had checked the "no proxy" option. Then I created an exception in my antivirus for Android Studio, and deleted the lines of proxy configuration of my gradle.properties file. Finally, I clicked on Sync Project with gradle files and it worked.

    0 讨论(0)
  • 2020-11-29 10:39

    try the latest version of gradle build tools in build.gradle(Module:app)

    here a screenshot

    screenshot

    0 讨论(0)
  • 2020-11-29 10:41

    Just sharing what works for me.

    • Go to file
    • Invalidate cache / Restart
    • Select Invalidate & Restart

    It should work now.

    Happy coding :)

    0 讨论(0)
  • 2020-11-29 10:41

    In Android Studio3.6.1 you can set the Proxy and after that, you can change that to no proxy. If still having the same issue then follow these step;-

    1). Check the Gradle location from in Settings->Build, Execution, Deployment->Gradle-find the location of Gradle in your PC.

    2). Now go to that location and open Gradle.properties file. in this file, you have to remove the proxy settings lines.

    3). That's it now your project is working

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