android开发环境问题汇总

本文汇总了Android开发过程中遇到的一些环境问题及其解决方法,包括ADT版本过低、SDK Tools版本不匹配、aapt.exe停止工作以及adb 5037端口被占用的问题。针对这些问题,给出了详细的操作步骤,帮助开发者快速解决这些问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题1:adt版本过低

解决方法:

  1. Start Eclipse, then select Help > Install New Software.
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:

    https://dl-ssl.google.com/android/eclipse/

  4. Click OK.

    If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).

  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish.

    If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.

  8. When the installation completes, restart Eclipse.

 

问题2:This version of ADT requires android SDK Tools revision 21.0.0 rc9 or above. Current version is 20.0.0 Please update your SDK Tools to the latest version

解决方法:打开sdk manager,安装tools下的的所有内容

 

问题3:在android开发时,当build项目时,发生如下异常:aapt.exe已停止工作

解决方法:发生这个错误是资源文件或是xml文件中有错误造成的,但是文件本身不会报错,所以要仔细检查,很可能是高版本sdk切换到低版本造成的

 

问题4:adb 5037端口被占用

1.禁用占用端口的服务,哪个是logAndAdapter服务,完全没用可以禁止

C:\Users\sanbo>netstat -aon|findstr "5037"  //查看占用5037端口的占用者
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       4352
C:\Users\sanbo>tasklist|find "5037"  //查看服务进程号

此时进入任务管理器--服务--右键--停止运行 即可

2.修改注册列表的方法,把adb端口更改。

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v ANDROID_ADB_SERVER_PORT /t REG_SZ /d 7305

3.更简单的方法,修改环境变量即可

其实这个做法和第二步是一样的效果

邮件电脑属性,设置环境变量,在环境变量中添加ANDROID_ADB_SERVER_PORT的选项,其值可自定义,如 7035保存,即可,设置后重启机器

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值