標籤:android style blog http java color
Android SDK Manager 更新失敗的解決方案
原文地址
最近使用Android SDK Manager 更新Android SDK tools 發現經常更新失敗,擷取不到更新資訊:
Java代碼
- Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
- Fetched Add-ons List successfully
- Fetching URL: https://dl-ssl.google.com/android/repository/repository-7.xml
- Done loading packages.
- Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
- Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: peer not authenticated
- Fetched Add-ons List successfully
- Fetching URL: https://dl-ssl.google.com/android/repository/repository-7.xml
- Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-7.xml, reason: SSLPeerUnverified peer not authenticated
- Done loading packages.
Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xmlFetched Add-ons List successfullyFetching URL: https://dl-ssl.google.com/android/repository/repository-7.xmlDone loading packages.Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xmlFailed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: peer not authenticatedFetched Add-ons List successfullyFetching URL: https://dl-ssl.google.com/android/repository/repository-7.xmlFailed to fetch URL https://dl-ssl.google.com/android/repository/repository-7.xml, reason: SSLPeerUnverified peer not authenticatedDone loading packages.
上述是Android SDK Manager Log的更新失敗的資訊,如:
這個資訊是網路上https的網路連接不上造成的,所以需要把https都換成http。
操作如下,點擊SDK Manager的Tools->Options
選擇 Force https://... sources to be fetched using http://
如,見紅色框處
當然如果你有VPN或公司有代理可以連上美國的google,那可以在Proxy裡面設定代理的IP和連接埠
設定完後更新就會成功
Log的結果如下:
Java代碼
- Fetching http://dl-ssl.google.com/android/repository/addons_list-2.xml
- Fetched Add-ons List successfully
- Fetching URL: http://dl-ssl.google.com/android/repository/repository-7.xml
- Done loading packages.
- Fetching http://dl-ssl.google.com/android/repository/addons_list-2.xml
- Validate XML
- Parse XML
- Fetched Add-ons List successfully
- Fetching URL: http://dl-ssl.google.com/android/repository/repository-7.xml
- Validate XML: http://dl-ssl.google.com/android/repository/repository-7.xml
- Parse XML: http://dl-ssl.google.com/android/repository/repository-7.xml