syr
syr

Reputation: 934

Android Studio Failed to fetch - Connection refused: connect

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.

Upvotes: 3

Views: 14316

Answers (2)

div
div

Reputation: 1533

If you are on Windows, try running Android Studio as Administrator. It solved the problem for me. I am using Android Studio 1.5.1.

EDIT: The problem came up again and this time, it was solved by setting the HTTPS Proxy as well in addition to HTTP Proxy. More details here.

Upvotes: 0

Aakash Upadhyay
Aakash Upadhyay

Reputation: 51

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".

Upvotes: 5

Related Questions