2

Good day!! I'm new to android development... I've successfully started my Android Development Studio, downloaded the necessary SDKs via sdk manager, and created a project. I'm following a tutorial where it says that I should be able to run my project (Blank Activity) after setting up a virtual device. Problem is I was able to run the virtual device but I cannot run my project. I kept on receiving the error: Gradle "MyApplication4" project refresh failed Error: Connection refused: connect i've tried using the solution provided here (AndroidStudio gradle proxy) but issue still occurs:

I went to File >> Settings >> Project Settings >> Gradle... Under Global Gradle Settings, I set Gradle VM options to -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080

I cannot post screenshots since I'm also new here at StackOverflow.

Kindly help me in solving this issue.

Community
  • 1
  • 1
onad
  • 31
  • 3

1 Answers1

0

I had a similar problem starting out; this is what worked for me:

When I set the proxy in the regular menu it appears not to have set the https properties, only http properties. I ended up adding the https properties myself by editing the gradle.properties file (literally as simple as copying the 4 lines beginning with systemProp.http.proxy and adding an "s" to to get systemProp.https.proxy).

The file would look like this:

systemProp.http.proxyPassword=[PASSWORD]
systemProp.http.proxyHost=[IP ADDRESS]
systemProp.http.proxyPort=[PORT]
systemProp.http.proxyUser=[USERNAME]
systemProp.https.proxyPassword=[PASSWORD]
systemProp.https.proxyHost=[IP ADDRESS]
systemProp.https.proxyPort=[PORT]
systemProp.https.proxyUser=[USERNAME]
Snowman
  • 3,170
  • 1
  • 18
  • 28