0

I have exactly this problem:

Android SDK installation issue - Peer not authenticated

I am trying to install the Android SDK and I get the following error in the SDK Manager Logs -

Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml,
reason: peer not authenticated
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-5.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-5.xml, reason:
peer not authenticated
Done loading packages.

I'm not behind a proxy and all the responses I've found there, and in other similar questions, are:

enable the "Force https://... sources to be fetched using http://..." setting in the SDK Manager Tools > Options menu.

But I'm on a CentOS 6 installation without GUI (it's a continuous integration server).

How can I force or set this configuration when running from command line?

Edit: I've also checked that the files can be downloaded with wget:

wget https://dl.google.com/android/repository/repository-11.xml
Community
  • 1
  • 1
Tobías
  • 6,142
  • 4
  • 36
  • 62

1 Answers1

2

It could not be easier, I don't know how I missed it (-‸ლ) :

./android list sdk --no-ui --no-https

The --no-https option does the trick. It is described in the help section of the action:

$ ./android --help list sdk

       Usage:
       android [global options] list sdk [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                   Action "list sdk":
  Lists remote SDK repository.
Options:
  -o --obsolete  : Deprecated. Please use --all instead.
  -a --all       : Lists all available packages (including obsolete and
                   installed ones)
     --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
     --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
  -s --no-https  : Uses HTTP instead of HTTPS (the default) for downloads.
  -e --extended  : Displays extended details on each package
  -u --no-ui     : Displays list result on console (no GUI) [Default: true]
Tobías
  • 6,142
  • 4
  • 36
  • 62