Android Studio Failed to fetch - Connection refused: connect

Christian Schäfer picture Christian Schäfer · Jan 19, 2015 · Viewed 13k times · Source

Android Studio Setup Wizard (studio64.exe) is not able to fetch some XMLs.

I have set in studio64.exe.vmoptions

-Djava.net.preferIPv4Stack=true
-Dhttp.proxyHost=... 
-Dhttp.proxyPort=...

Also tried

-Dhttp.proxyHost=www.google.com 
-Dhttp.proxyPort=80

But nothing works and I didn't find anything helpful on google seeming like I'm the only one with that problem.

Details:

Android SDK was installed to C:\Users\*\AppData\Local\Android\sdk
Refresh Sources:
  Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: Connection refused: connect
  Fetched Add-ons List successfully
  Refresh Sources
  Failed to fetch URL http://dl-ssl.google.com/android/repository/repository-10.xml, reason: Connect Connection refused: connect
Refresh Sources:
  Failed to fetch URL http://dl-ssl.google.com/android/repository/repository-10.xml, reason: Connect Connection refused: connect
There is nothing to install or update.
The following SDK component was not installed: build-tools-21.1.1

I'm using a lot of dev tools without a problem and Android Studio is now the first one with connectivity issues.

The XML files mentioned I can access via browser without a problem.

Answer

Aakash Upadhyay picture Aakash Upadhyay · Jan 19, 2015

I had a similar issue when working behind a proxy server on x86 system. Initially the Studio doesn't provide any interface for settings so the following has to be done.

Proxy settings for Android Studio should be made in "other.xml" which resides in "D:\Users\%UserProfile%.AndroidStudio\config\options" (in my system).

To manually set a proxy find "USE_HTTP_PROXY" and make it's value = "true" followed by proper "PROXY_HOST" and "PROXY_PORT" values.

To automatically detect the present proxy settings find "USE_PROXY_PAC" and make it's value = "true".