Android报错及解决方案


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?

解决:

活动用intent连接 但清单文件未注册 ---解决 ---注册清单文件(不要马虎大意)




8.

错误:

[2014-05-23 08:51:46 - ExtenalStorageDemo] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.

解决方案:


9.

在eclipse里报这个错误:
Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please fix project properties


解决一:

1. 项目 右键 ->android tools ->Fix Project
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一下项目,这个方法可以解决 。



















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值