自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android SDK更新以及ADT更新出現(xiàn)問題的解決辦法

移動(dòng)開發(fā) Android
在Android來發(fā)過程中我們經(jīng)常會(huì)遇到有關(guān)SDK和ADT的更新問題,有時(shí)候會(huì)很棘手,很難解決,下面就奉上問題的解決方案。

問題描述

使用SDK Manager更新時(shí)出現(xiàn)問題

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-6.xml, reason: Connection to https://dl-ssl.google.com refused

Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection to http://dl-ssl.google.com refused

Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>

更新ADT時(shí)無法解析https://dl-ssl.google.com/android/eclipse

解決辦法

由于某些眾所周知又無法理解的原因,我們大陸使用Google的服務(wù)會(huì)出現(xiàn)種種問題,譬如Android開發(fā)也會(huì)出現(xiàn)阻礙。不過首先要說明的是一般情況下使用SDK Manager更新或者更新Eclipse的ADT插件是沒有問題的,我以前也能正常更新,但是昨天不知道節(jié)點(diǎn)抽什么風(fēng),壓根無法連接服務(wù)器,出現(xiàn)了上邊的種種問題,下面說一下如果網(wǎng)絡(luò)抽風(fēng)的話應(yīng)該如何解決問題。

第一種方法一勞永逸,直接配置VPN,但是現(xiàn)在想找個(gè)速度快又穩(wěn)定還免費(fèi)的VPN實(shí)在不易,尤其是更新SDK,以幾kb/s的速度一個(gè)文件需要400多分鐘,所以也就放棄了VPN。

另一種方法是使用http協(xié)議而不是https協(xié)議,因?yàn)閔ttps協(xié)議進(jìn)行了加密處理,大陸因?yàn)闊o法審查,直接封死,而http協(xié)議則進(jìn)行過濾處理,如果不訪問亂七八糟的東西,更新個(gè)SDK還是沒問題的。

在SDK Manager下Tools->Options打開了SDK Manager的Settings,選中“Force https://… sources to be fetched using

http://…”,強(qiáng)制使用http協(xié)議。

而在更新ADT插件的時(shí)候則使用網(wǎng)址http://dl-ssl.google.com/android/eclipse,而不是https://dl-ssl.google.com/android/eclipse,這個(gè)在官

方開發(fā)文檔里也有介紹。

但是昨天的情況就是使用http協(xié)議也無法訪問。

再說一個(gè)比較麻煩的方法,就是直接打開

https://dl-ssl.google.com/android/repository/addons_list.xml

https://dl-ssl.google.com/android/repository/repository.xml

https://dl-ssl.google.com/android/repository/addon.xml

這幾個(gè)文件,找到你要下載的文件名,直接用迅雷下載,ADT可以直接在官網(wǎng)下載ADT包進(jìn)行安裝。具體方法自己搜索。

最好的方法還是改hosts文件的方法,更新速度較快。Windows在C:\WINDOWS\system32\drivers\etc目錄下,Linux用戶打開/etc/hosts文件。

 

打開文件后添加以下內(nèi)容。

 

#Google主頁

 

203.208.46.146 www.google.com

 

#這行是為了方便打開Android開發(fā)官網(wǎng) 現(xiàn)在好像不翻墻也可以打開

 

74.125.113.121 developer.android.com

 

#更新的內(nèi)容從以下地址下載

 

203.208.46.146 dl.google.com

 

203.208.46.146 dl-ssl.google.com

 

添加以上的網(wǎng)址,再選用http協(xié)議,就可以正常的進(jìn)行更新了。

 

或者也可以什么都不做,過上一兩天可能會(huì)恢復(fù)正常。

 

下邊貼上使用Google各種服務(wù)在修改hosts文件時(shí)需要添加的內(nèi)容。

 

#Google Service

#Chrome 網(wǎng)上應(yīng)用

203.208.46.146 chrome.google.com

 

203.208.46.146 clients0.google.com

 

203.208.46.146 clients1.google.com

 

203.208.46.146 clients2.google.com

 

203.208.46.146 clients3.google.com

 

203.208.46.146 clients4.google.com

 

203.208.46.146 www.googleusercontent.com
203.208.46.146 lh0.googleusercontent.com
203.208.46.146 lh1.googleusercontent.com
203.208.46.146 lh2.googleusercontent.com
203.208.46.146 lh3.googleusercontent.com
203.208.46.146 lh4.googleusercontent.com
203.208.46.146 lh5.googleusercontent.com
203.208.46.146 lh6.googleusercontent.com
203.208.46.146 clients1.googleusercontent.com
203.208.46.146 clients2.googleusercontent.com
#網(wǎng)頁快照
203.208.46.146 webcache.googleusercontent.com
#Google SSL
203.208.46.146 encrypted.google.com
203.208.46.146 encrypted.google.com.hk
#Google Docs
203.208.46.146 docs.google.com
203.208.46.146 docs0.google.com
203.208.46.146 docs1.google.com
203.208.46.146 docs2.google.com
203.208.46.146 docs3.google.com
203.208.46.146 spreadsheets.google.com
203.208.46.146 spreadsheets0.google.com
203.208.46.146 spreadsheets1.google.com
203.208.46.146 spreadsheets2.google.com
203.208.46.146 spreadsheets3.google.com
#Gmail
203.208.46.146 mail.google.com
203.208.46.146 chatenabled.mail.google.com #Gmail中Gtalk聊天服務(wù)
#Google 搜索
203.208.46.146 www.google.com
#Google preview
203.208.46.146 www.googlepreview.com
#Google 翻譯
203.208.46.146 translate.google.com
203.208.46.146 translate.googleapis.com
#Google 搜索建議(IE9)
203.208.46.146 clients5.google.com
#Google Code
203.208.46.146 code.google.com
#Picasa 網(wǎng)絡(luò)相冊
203.208.46.146 picasaweb.google.com
203.208.46.146 lh0.ggpht.com
203.208.46.146 lh1.ggpht.com
203.208.46.146 lh2.ggpht.com
203.208.46.146 lh3.ggpht.com
203.208.46.146 lh4.ggpht.com
203.208.46.146 lh5.ggpht.com
203.208.46.146 lh6.ggpht.com
203.208.46.146 lh7.ggpht.com
203.208.46.146 lh8.ggpht.com
203.208.46.146 lh8.ggpht.com
203.208.46.146 lh9.ggpht.com
203.208.46.146 lh6.google.com
#Google 個(gè)人資料
203.208.46.146 profiles.google.com
203.208.46.146 browsersync.google.com
#Google+
203.208.46.146 talkgadget.google.com #Google+中的聊天服務(wù)
203.208.46.146 ssl.gstatic.com
203.208.46.146 images-pos-opensocial.googleusercontent.com
203.208.46.146 images1-focus-opensocial.googleusercontent.com
203.208.46.146 images2-focus-opensocial.googleusercontent.com
203.208.46.146 images3-focus-opensocial.googleusercontent.com
203.208.46.146 images4-focus-opensocial.googleusercontent.com
203.208.46.146 images5-focus-opensocial.googleusercontent.com
203.208.46.146 images6-focus-opensocial.googleusercontent.com
203.208.46.146 plus.google.com
#Download 下載
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
#Groups
203.208.46.146 groups.google.com
#Google URL Shortener
203.208.46.146 goo.gl
#Google App Engine
203.208.46.146 appengine.google.com
#Android Developer

74.125.113.121 developer.android.com

責(zé)任編輯:張葉青 來源: eoe Android開發(fā)者社區(qū)
相關(guān)推薦

2020-08-17 17:03:58

Windows 10Windows操作系統(tǒng)

2015-07-28 16:24:11

Windows 10更新

2009-12-02 18:16:35

PHP mail發(fā)送郵

2010-02-06 09:20:08

保護(hù)盾MSN無法啟動(dòng)

2023-03-21 12:38:29

微軟Windows 11

2021-04-17 06:10:40

Windows 10Windows操作系統(tǒng)

2009-06-18 16:21:45

Hibernate更新Hibernate更新

2011-04-19 11:41:03

Access數(shù)據(jù)庫

2011-08-03 18:41:14

2021-05-31 06:57:53

Windows10操作系統(tǒng)微軟

2013-04-24 11:04:52

Android開發(fā)Android SDK

2017-11-27 08:57:54

AndroidiOS移動(dòng)系統(tǒng)

2015-05-12 16:15:18

大數(shù)據(jù)數(shù)據(jù)類型

2009-12-03 17:36:02

PHP Date()出

2011-03-31 14:14:37

SQL Server 數(shù)據(jù)庫批量更新

2018-10-15 13:00:04

Windows 10Windows系統(tǒng)更新

2009-02-18 09:30:10

AJAX跨域XML

2010-05-04 13:52:00

Oracle用戶被鎖

2023-09-07 07:06:56

2023-06-06 14:53:18

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號