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
This happened to me when I updated Android Studio to the latest version.
The fix was to go to File/Settings/Build Execution Deployment/Gradle
and check Use local gradle distribution
After that, in Gradle Home
put the location to the gradle directory - in my case it was C:\Program Files\Android\Android Studio\gradle\gradle-3.2
I am writing on this old post as I have also faced the same problem after updating the Android Studio to 3.5. I was not using any proxy setting in my current project, still, it was showing me connection refused error. To resolve this problem I deleted the .android and .gradle file from User folder and restarted the android studio. It helped me to rebuild the project successfully.
Hope it will help you out.
For me it worked like this:
.gradle
file. location: C:\Users\user\.gradle
P.S. There is no proxy in my system (windows 8.1)
and it worked! hope this helps.
This worked for me
systemProp.https.proxyPort=41258 systemProp.http.proxyHost=109.199.77.83 systemProp.https.proxyHost=109.199.77.83 systemProp.http.proxyPort=41258
I solved my problem by putting the proxy options with http
and https
. Before it was just http
and was giving error, after I added https
, it worked.
I've searched everywhere for the answer spend 3 days and finely find the solution is to disable Avast in my case, so if you are too had an antivirus try it or make an exception for Android Studio.