46

I'm trying to install a platform but when I open Android Manager then I click Available Software then select the https://dl-ssl.google.com/android/repository/repository.xml repository

I get this error:

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml

I have also tried downloading by clicking on force "http:" for all "https:" downloads on settings panel but it still doesn't help.

I'm working on Windows Vista.

Shog9
  • 156,901
  • 35
  • 231
  • 235
Vaibhav
  • 6,620
  • 11
  • 47
  • 72
  • What happens when you click those links in a browser? I am thinking your firewall/anti-virus may be blocking Eclipse from accessing the internet. – Austyn Mahoney Sep 27 '10 at 23:29
  • 1
    yes sir it opens in the browser.. but as even you can see it does not appear to me as xml file. – Vaibhav Sep 28 '10 at 05:31
  • 2
    any luck resolving this? I've disabled my firewall and tried the https with no luck either – amadib Sep 22 '11 at 02:21
  • I got this error but by disabling my avg antivirus it worked.. – abhinav Sep 02 '12 at 18:14
  • 5
    Solution sdk manager -> tools proxy server: www.google.com proxy port : 80 and choose Force https://.... sources then click packages -> reload,the problem is gone. – Rakesh Patil May 25 '14 at 13:18
  • it works... http://stackoverflow.com/questions/9993690/set-android-sdk-behind-server-proxy – Mohammed mansoor Aug 19 '14 at 06:10
  • In my case I had to disable "use download cache" in the SDK manager options to make it work. (Windows 8) – Krumelur Dec 16 '14 at 08:20
  • 1
    million dollar question, if anyone face this problem in a big company, no solution... u can't disable firewall or antivirus there... Google should do something about this. I get into this problem in every company and then have to declare war against IT support guys – Shirish Herwade Jul 28 '15 at 09:29
  • for newer versions of android studio which sdk manager isn't standalone: https://stackoverflow.com/questions/48645087/error-in-updating-android-sdk-org-xml-sax-saxparseexception – Masa Feb 12 '18 at 08:23

17 Answers17

70

Try this solution and it worked. this problem is caused because ADB is unable to connect to the android servers to fetch updates. (If at home try turning off firewall)

  • Goto Android SDK Manager c://android-sdk-windows/ open SDK-Manager
  • Click Settings - Will be asked for a proxy.
  • If have one enter the IP address and the port number. If not turn off your firewall.
  • Check "Force https://... " (to force SDK Manager to use http, not https)

This should work immediately.

Nate
  • 31,017
  • 13
  • 83
  • 207
Akh
  • 5,961
  • 14
  • 53
  • 82
  • 1
    @dubayya : Inside Internet explorer, Press Alt+t -> Select Internet Options -> Select connections tab -> Click Lan settings. You can see Proxy settings there. Address and Port Number need to be updated for this particular problem. – Sandeep Apr 04 '12 at 08:45
21

If you enter the URL in a browser and then look at the source code of the page you will see that an XML document is returned.

The reason why that URL would work in a browser but not in the android manager might be that you are required to specify a proxy server. In Eclipse (3.5.2) the proxy settings can be found here: "Window" -> "Preferences" -> "General" -> "Network Connections"

Volker Voecking
  • 5,203
  • 2
  • 38
  • 35
16

All that was necessary for me, a Ubuntu user, was to change the owner of the ~/.android directory. In a terminal type the following command:

sudo chown -R username:username ~/.android

Obviously, you must replace "username" (twice) with your username.

I wasn't sure if I should post this as an answer because the original poster's question was concerning Windows Vista, not Ubuntu. However I found this post whilst searching for the answer on Ubuntu so I believe it is pertinent. I don't have sufficient reputation to comment on +Maher Gamal's answer, though, which is what lead me to this answer. Hopefully someone else finds it useful!

Jonathan
  • 6,507
  • 5
  • 37
  • 47
  • 1
    Yes I installed the Android SDK manager by installing the entire Android studio. The instructions said to run the installer as sudo. That caused a few problems with root owning files including what you fix here. Thx a lot. – Joe C Dec 09 '14 at 23:37
  • This also helps in Windows, the `%UserProfile%\.android` folder must have read/write permissions. This fixed the problem for me, thanks! – Sreenikethan I Jun 30 '18 at 06:12
12

In Mac OS X, the solution is creating the file androidtool.cfg in our user .android folder and then add this line. Sure it is working also for Linux

sdkman.force.http=true

I hope that helps!

Kasas
  • 1,216
  • 2
  • 18
  • 28
  • When launching the android SDK manager for the first time on OSX my toolbar is disabled and I couldn't set this option via the UI. Your answer was very helpful! – Karl the Pagan Apr 21 '15 at 16:18
7

Open Android SDK Manager and open menu Tools->Options

in Proxy Setting Part Set your proxy and ok

Pacerier
  • 86,231
  • 106
  • 366
  • 634
Saber Fathollahi
  • 311
  • 1
  • 3
  • 10
3

Investigating this error on my new Win 7 laptop, I found my ADT plugin to be missing. By adding this I solved the problem: Downloading the ADT Plugin

Use the Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer.

Assuming that you have a compatible version of the Eclipse IDE installed, as described in Preparing for Installation, above, follow these steps to download the ADT plugin and install it in your Eclipse environment.

Start Eclipse, then select Help > Install New Software.... Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ Click OK

Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons). In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish.

Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. When the installation completes, restart Eclipse.

Vaibhav
  • 6,620
  • 11
  • 47
  • 72
John Ashmore
  • 1,015
  • 1
  • 10
  • 25
3

I am using Kaspersky. I just turned it off and the issue was solved!

Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417
3

I got the solution for the Android Studio installation after trying everything that I could find on the Internet. If you're using Android Studio and getting this error:

Find [Path_to_Android_SDK]\sdk\tools\android.bat. In my case, it was in C:\Users\Nathan\AppData\Local\Android\android-studio\sdk\tools\android.bat.

Right-click it, hit Edit, and scroll all the way down to the bottom.

Find where it says: call %java_exe% %REMOTE_DEBUG% ...

Replace that with call %java_exe% -Djava.net.preferIPv4Stack=true %REMOTE_DEBUG% ...

Restart Android Studio/SDK and everything works. This fixed many issues for me, including being unable to fetch XML files or create new projects.

Nathan
  • 315
  • 4
  • 9
2

I had the same problem: the latest update failed to install because it couldn't rename the tools folder in android-sdk-windows. I'm using AVG antivirus and disabling it didn't help, but I don't think it had anything to do with the AV program anyway.

Fact is, running the Android SDK setup apparently uses items in the "android-sdk-windows\tools" directory. I'm on Win Vista x32 so maybe that causes some unique situation - I'm not sure.

Solution:

  • I made a copy of the tools folder itself (keeping it at the same directory tree level, thus "tools" and "tools-copy" were both in the "android-sdk-windows" folder).

  • I ran Android.bat from that copy

  • I ran the update without problems (it updated the original, not-being-used-at-the-moment tools folder, among whatever other items it needed to).

  • I closed the SDK, deleted the folder (I had to kill the adb.exe process first - not sure why that always persists but you can't delete the folder without doing that).

  • I restarted the SDK from the normal (now-updated) tools folder. Worked like a charm!

Note that simply killing adb.exe was NOT sufficient to get around the original issue... only by copying the tools folder and using the copy to run Android for the duration of the update process was enough to rectify the problem.

I hope this helps others... it's quite vexing to have to spend time resolving basic issues like this just to run an update.

Jomia
  • 3,414
  • 10
  • 46
  • 63
1

If you open /Users/{your name}/android sdks/tools/android (double click it), then click on "Android SDK Manager" menu and then "Preferences" and then you can change your proxy settings specifically for Android SDK Manager. These proxy settings also apply to "Android SDK Manager" if used within Eclipse.

Mark Peterson
  • 570
  • 5
  • 19
1

After 7 long hours of searching I finally found the way!! None of the above solutions worked, only one of them pointed towards the issue!

If you are on Win7, then your Firewall blocks the SDK Manager from retrieving the addon list. You will have to add "android.bat" and "java.exe" to the trusted files and bingo! everything will start working!!

anemo
  • 1,327
  • 1
  • 14
  • 28
  • Note that in the default configuration, the Windows firewall will not interfere with the SDK Manager. You must have had outbound filtering enabled. – Harry Johnston Feb 18 '16 at 21:51
0

I had the same problem. I use Ubuntu 12.04. I tried disabling ipv6.

Modify the /etc/sysctl.conf and add the following:
#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Then restart the machine and check. I think this may be a ipv6 issue even in Windows OS.

Rukmal Dias
  • 3,242
  • 1
  • 34
  • 28
0

I had a similar situation where I had the proxy settings already set and the SDK manager wasn't able to modify them permanently. Modifying manually the ~/.android/androidtool.cfg file fixed the issue.

Maher Gamal
  • 96
  • 2
  • 3
0

Had the same issue on 64 bit win7 machine on company network behind proxy with automatically detected settings.

After a number of trials and failures the following workaround proved to be successful:

  • sharing my phone's wifi internet connection via USB

Best regards, Robert

throbi
  • 127
  • 1
  • 3
0

I found another way without setting proxy. I'm currently using an antivirus which has a firewall program. Then, I turn off this firewall and now I can fetch that URL.

If still doesn't work, try to turn off Firewall on your PC, such as Windows Firewall.

Anggrayudi H
  • 14,977
  • 11
  • 54
  • 87
0

I had the same problem, made all the workarounds you advised: still the same error. I updated Eclipse via "Help / Check for updates" and now everything is ok. This update brought a completely new version of the Android SDK Manager.

Marcio
  • 80
  • 3
0

Also, try to turn off your firewall and try to update with link.