1 问题描述:
运行android程序控制台输出
[2012-07-18 16:18:26 - ] The connection to adb is down, and a severe error has occured.
[2012-07-18 16:18:26 - ] You must restart adb and Eclipse.
[2012-07-18 16:18:26 - ] Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be executed.
问题解决:
C:\Users\Administrator>adb kill-server
C:\Users\Administrator>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
C:\Users\Administrator>
2 .报错:
BUILD FAILED
D:\workspace\ganji\build.xml:144: The following error occurred while executing this line:
D:\workspace\ganji\build.xml:271: Unable to delete file D:\workspace\ganji\tmp\proguard\tmp.jar
解决:
已经开了一个模拟器了,无法重新编译,必须关闭一个。
3.
报错:
014-04-18 18:19:04 - unknow] Failed to install unknow.apk on device '2091d019': timeout
[2014-04-18 18:19:04 - unknow] Launch canceled!
解决:
重启eliplise
4.
报错:
[2014-04-18 18:52:41 - MainActivity] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
解决:
修理工程:Fix Project
5.
xml文件中的id问题
解决方法 :纠正id: 检查加载布局文件是否正确
6.
错误:
04-21 13:02:26.883: E/AndroidRuntime(19013): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
解决:
类型不匹配异常GridView 中//设置布局宽高时要注意 LayoutParams方法是那个类的
7.
错误:
04-30 08:48:33.788: E/AndroidRuntime(22356): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.l_g/com.example.l_g.Activity01}; have you declared this activity in your AndroidManifest.xml?
解决:
8.
错误:
解决方案:
9.
Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please fix project properties
解决一:
2. 如果不可以,检查Project -> Properties->Java Compiler
确认JDK compliance被设置为1.6,并且enable specific seetings.
解决二:
adb默认端口5037
1>5037端口使用情况
netstat -aon|findstr "5037"
2》占用5037端口的应用那个程序
tasklist|findstr "4024"
3》杀死占用端口程序
taskkill /f /im eclipse.exe
10.
java.io.FileNotFoundException: /mnt/sdcard/Pictures/1403230541317.jpg: open failed: EACCES (Permission denied)
忘加权限---(是不是马虎了)
11.
错误:
Incorrect line ending: found carriage return (\r) without corresponding newline (\n)
解决方案: ——clean一下项目,这个方法可以解决 。
12.
新建的Android工程有两个清单文件,
解决方案: ——clean一下项目,这个方法可以解决 。