初涉及Andriod App开发,按照文档搭建开发环境时,如果某一步没有执行成功就有可能如有下面的问题,无法选择Theme, 不论是Holo Light with Dark Action Bar, 还是Holo Light, Holo Dark,甚至是None。如下图,这里的原因是Andriod SDK并没有安装成功。

解决办法:

重新安装Andriod SDK。

先下载Andriod SDK Manager, 然后通过SDK Manager来下载SDK等其他包。这里要注意的是,如果总是失败,遇到connection Refused,如下面的错误,很有可能就是你在使用代理,但却没有设置SDK Manager的网路设置。

*SDK manager Log*
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-10.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: Connection to https://dl-ssl.google.com refused
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-10.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: HttpHostConnect Connection to https://dl-ssl.google.com refused
Done loading packages.
Fetching URL: https://dl-ssl.google.com/android/repository/repository-10.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
Done loading packages.
Fetching URL: http://dl-ssl.google.com/android/repository/repository-10.xml
Failed to fetch URL http://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
Done loading packages.

或检查其是否设置正确:

进入Eclipse Window -> Preferences -> Andriod -> SDK Location

如图:

发表评论