问题1:adt版本过低
解决方法:
- Start Eclipse, then select Help > Install New Software.
- Click Add, in the top-right corner.
-
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/
-
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).
- In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
- In the next window, you'll see a list of the tools to be downloaded. Click Next.
-
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.
- 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保存,即可,设置后重启机器