问题描述:

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.

The error has something to do with proxy settings etc. I am running Ubuntu 11.10 and I had installed the SDK comfortably on the same setup yesterday.

网友答案:

As a workaround, I enabled the "Force https://... sources to be fetched using http://..." setting in the SDK Manager Tools > Options menu.

If you use Android Studio instead of the standalone SDK Manager, Choose "SDK Update Sites" in the "Android SDK" settings and click the checkbox in the lower part of the screen.

That seems to help. I suspect it is a server side problem, but I'm not sure about that.

Edit: Please note that using http instead of https is not really the best idea! In the worst case, a man-in-the-middle attack could inject malicious code into your Android SDK libraries that ends up in your APK. That's why it's called a workaround :)

网友答案:

In my particular case, I had the "Peer not authenticated" error on my android device as the system time on my device was set in the past, no issues with your system time?

Thanks to this page for pointing out the seemingly obvious... :)

网友答案:

I have faced the sam problem in Windows. Then it worked for me after doing the following steps:

  • Open cmd as administrator
  • ping developer.android.com
  • Go to the SDk manager and retry the installation
网友答案:

For me, in Windows 7, I had to run the SDK Manager as administrator (right click / run as administrator). From then SKD Manager downloaded and installed just fine.

网友答案:

It is very likely that you are getting this when you are within a corporate network and your corporate is using some sort of Browser proxy.

If that is the case and you are using VPN software to get on the corporate network, then disconnect from the VPN to allow your machine to be on the Internet "directly".

网友答案:

I disabled firewall and then tried running SDK Manager.exe as administrator.It started downloading some packages without fail though some packages are still failing to download with the error "Download interrupted: peer not authenticated". So try to re run the sdk manager again it will download some packages now.

网友答案:

For those who have Mac enable "Force https://... sources to be fetched using http://..." going to:

SDK Manager Tools > Preferences > "Force https://... sources to be fetched using http://..."

P.S: Thanks to @danilo-bargen for the answer. He gave the answer for Windows

网友答案:

There is a package ca-certificates-java.

When using OpenJDK, it is installed automatically.
When using the Oracle's JDK with WebUpd8 PPA (Ubuntu), it is not.

网友答案:

I solved my problem in this way: First open the date and time settings of your computer and second: update it to the current date and time. Thats all.

网友答案:

I choose the "Force https://... sources to be fetched using http://..." option and restarted the "SDK Manager", but it still didn't work. Then I right-clicked on the "Android SDK Tools" --> "SDK Manager" and choose "Run as Administrator". After which, it started to download the packages. I'm on Windows 10.

相关阅读:
Top