运行程序出现如下错误:
The connection to adb is down, and a severe error has occured.
You must restart adb and Eclipse.
Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe'
此情况是其他进程监听了abd端口(5037),而不是adb。
解决方法:进入dos窗口,输入:netstat -aon|findstr "5037",就会出现占用的进程的PID,然后启动任务管理器,找到此PID,然后结束进程,重启eclipse即可。
错误提示:
[2014-01-16 09:27:35 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2014-01-16 09:27:35 - tab_demo] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
解决办法:
右键选择项目,选择Build Path——Configure Build Path...,然后在弹出框中选择:Java Build Path——Libraries,最后将Android Dependencies和Android Private Libraries移除(remove)掉即可。 我遇到这种问题的时候,Android Dependencies和Android Private Libraries里面都没有我项目所需的库,所以我remove掉之后不需要重新添加jar包,但是如果你的Android Dependencies和Android Private Libraries里面有项目所需的库的话,需要你重新引入,否则项目会报错,jar引入:右键选择lib中的jar文件选择Add Build Path即可。