android开发环境搭建遇到的问题

来源:互联网 发布:nginx mysql php 编辑:程序博客网 时间:2024/05/16 15:09
遇到的问题:
1.报错:Failed to fetch URLhttp://dl-ssl.google.com/android/repository/repository.xml
答:国内好像dl-ssl.google.com被封了,搭建android环境SDK失败了,不过在系统hosts文件最后添加74.125.237.1 dl-ssl.google.com就可以了!
2.报错:A folder failed to be renamed or moved.
答:这个是在android-sdk-windows中进行 update all 时报的错。
解决方案:1. 复制 tools目录为一个新的目录 tools-copy ,此时在android-sdk-windows 目录下有两个目录 tools 和 tools-copy
2. 在tools-copy目录运行 android.bat ,这样就可以正常 update all 了,之后,关闭 sdk.
3. 在 android-sdk-windows 目录运行 SDK Setup.exe, 就可以了.
3.eclipse添加android配置时,报错:Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 17.0.0.v201203161636-291853 (com.android.ide.eclipse.adt.feature.group 17.0.0.v201203161636-291853)
Missing requirement: Android Development Tools 17.0.0.v201203161636-291853 (com.android.ide.eclipse.adt.feature.group 17.0.0.v201203161636-291853) requires 'org.eclipse.core.runtime 3.6.0' but it could not be found。
答:这个问题是eclipse版本的问题,你可以下载其他版本,或者更新该版本即可解决!
4.eclipse添加android配置时,报错:
An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,javax.xml,1.3.4.v201005080400
No repository found containing: osgi.bundle,org.apache.lucene.highlighter,2.9.1.v20100421-0704
......
答:这时由于是一个国外的网站,还需要代理才能访问,所以需要安装WST Server Adapters,点击菜单“Help->install new software...”输入http://download.eclipse.org/releases/galileo/后,只选择安装WST即可,只需要这个,如果全选,那可能会出现其他的暗转错误,比如其中有些需要在安装完其他平台软件后才能安装。(当然我们也可以选择eclipse+ADT压缩包进行离线安装,这样也是可以的!)
或者应该是你的elcipse里面的插件不全,重新下一个elcipse,最好是3.5以上的版本,而且有针对移动开发的Pulsar版本,里面的插件都很全。
5.link方式安装ADT:
答:1、下载ADThttp://dl.google.com/android/ADT-17.0.0.zip
2、解压ADT压缩包到G:\\Tools\\android-sdk-windows\\ADT-17.0.0下,删除压缩包中的web目录和xml文件(一定要这么做,否则不会安装ADT)
3、eclipse安装目录下的dropins新建一个adt.link,输入path=G:\\Tools\\android-sdk-windows\\ADT-17.0.0
4、删除eclipse安装目录下的configuration目录中org.eclipse.update文件夹。
5、重启eclipse,安装成功。