Android SDK and AVD Manager (Linux) : HTTP SSL error

Failed to Fetch
Android SDK 2.0 发布已经有些时间了,虽然 Windows 下的 SDK 早已经升级,但是 Debian 下的 SDK 一直还停留在1.6,于是翻墙去了 developer.android.com,下了安装文件,依照 SDK Readme.txt 的说明,执行 android。
鼠标点击左侧导航栏中的“Available Packages”,点击选中“https://dl-ssl.google.com/android/repository/repository.xml ”,然后点击“Refresh”,接着就会有窗口弹出,继而告诉你没办法获取,详细的信息如图所示。
根据错误提示,点击 Settings,选中“Force https://…”,点击“Save & Apply”,重新回到“Available Packages”,点击“Refresh”按钮,结果依旧。可以排除网址无法访问的可能性,--因为同样的操作在 Windows 下是成功的。
思考一下,前段时间的时候,我曾经在 Google Groups 里看到过类似问题的帖子,于是抱着疑问到 Android Developers 搜索了一下,果然看到了一模一样的问题。有位 ID 为 garycode 的人提问:Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml 。
So I click the settings tab and select the force through http then click apply and save then nothing happens it doesn’t save it because if i then close it and reload it the checkbox is unticked so it’s not even using the force through http method. I get the same error if i go straight back to available software.
随后有位 Android SDK Tech Lead 的成员 Xavier Ducroht 给出了一个可行的方法:
It looks like it fails somehow to create the file containing the settings, but I don’t know why (it works fine here).
The file is ~/.android/androidtool.cfg
try to create it manually and add one line to it: sdkman.force.http=true
不过有人反映可行也有人反应这个方案并不能解决问题。那么这个问题的原因到底是什么呢?有位 ID 为 Jay 的仁兄给出的解释看似是说到了点子上的:
For more details please see https://bugzilla.gnome.org/show_bug.cgi?id=598734 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=290395
看样子这涉及到了 Gnome 和 SWT 的问题了,这位仁兄也给出了一个建议:
Try export GDK_NATIVE_WINDOWS=true before running android sdk manager. It fixes both the save button and the install button for me.
而我采用的方案则显得有些山寨:
I accidently found out that if you select “force download through HTTP” by using the keyboard it will work! (by using TAB and the spacebar)
问题到了这里算是有了个交代,但是再回过头来看整个过程,让我不得不考虑开发环境的可靠性,一方面 Linux 让我感到自由和亲切,另一方面 Windows 的可靠性和众多的第三方软件让我放心,左拥右抱自然很好,就怕左拥右抱不成,变成了左右为难。
粤公网安备44030702004956号
嘿嘿,兄弟我也遇上了。我啥都没看,知道不支持https,换成HTTP马上好用。。。。有点经验了,没想那么多。
[…] 去年撰写过一篇博客,解释了如何将默认下载地址从 https 变更为 http,提到其中的原因是由于Gnome 和 SWT 的 BUG,这些小问题往往给人带来很不好的使用体验。事情过去一年多了,由于一些原因,又要安装 Linux 版的 Android SDK,发现去年的问题依旧存在,不幸的是,除此之外,又发现了一个新问题。 […]