最后更新于: 2014年12月19日14:27:26
转载请注明出处:
http://blog.csdn.net/bbld_/article/details/39520249【 Rocko's blog】
搬迁至:Android 错误集锦ing...


系统环境:

Windows7 64位

问题描述:

Eclipse真机无法打印log信息

错误提示:

解决方案:

window-->show view-->android->devices

打开devices,点击右边的截屏图片的按钮。等到出现截图的时候,logcat就出来信息了(不保证每次都有用)

系统环境:

Windows7 64位

问题描述:

xml(资源)文件里面的错误

错误提示:

android: invalid start tag xxxxx 错误原因

解决方案:

今天在学shape这个属性,结果创建的xml总是提示这个错误
百思不得其解,后来找到原因了
我把这个xml文件放错了位置,放到了res/layout路径下
应该放在drawable的路径下才对

系统环境:

Windows7 64位

问题描述:

无法run(运行)工程

错误提示:

Conversion to Dalvik format failed with error 1

解决方案:

第一种情况包导入错误.点击工程-->build path-->libraries-->选中android1.x 或者android2.x ,点击remove。
然后再点击add library-->User Library -->next-->User Libraries-->new 你取一个名字 比如android2.1 点击OK,
选中android2.1-->add jars-->\android-sdk-windows\platforms\android-7\android.jar 点击打开,点击ok-->finish.

第二种情况签名时没有成功。签名:java -jar signapk.jar platform.x509.pem platform.pk8 e:huaworkspace\hua\bin\hua.apk e:huaworkspace\hua\bin\hua_signaed.apk ,

如果hua_signaed.apk签名失败,那么请到你的工作目录中将hua_signaed.apk delete掉。

第三种情况包冲突,请到工程目录下将相同的包删除,重新导入一个,这一点和第一种情况类似,不过这是针对其他包,不是android包

系统环境:

Windows7 64位

问题描述:

导入SlidingMenu和SlidingMenu所依赖的actionbarsherlock包后再导入support v7(用来支持ActionBar),工程一直报错、无法生成R文件

错误提示:

。。。。。

解决方案:

不用导入v7包了,因为actionbarsherlock已经支持ActionBar,再导入v7会有冲突。

系统环境:

Windows7 64位

问题描述:

FragmentTransaction使用问题。

错误提示:

java.lang.IllegalStateException: commit already called.

解决方案:

是因为你的ft事务是全局的变量,只能commit一次。

所以用两个局部ft事务去做commit即可。 原文地址:http://blog.csdn.net/knxw0001/article/details/9363411 补充: FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); detailFragment = new ProductDetailFragment(productId); commentFragment = new ProductCommentFragment(productId); fragmentTransaction.add(R.id.viewgroup, detailFragment); fragmentTransaction.add(R.id.viewgroup, commentFragment); fragmentTransaction.commit(); //下面这个是调用的时候需要用新的局部变量 getSupportFragmentManager().beginTransaction().hide(commentFragment).show(detailFragment).commit();

系统环境:

Windows7 64位

问题描述:

使用Genymotion调试出现错误INSTALL_FAILED_CPU_ABI_INCOMPATIBLE

错误提示:

Installation error: INSTALL_FAILED_CPU_ABI_INCOMPATIBLE

Please check logcat output for more details.

Launch canceled!

解决方案:

点击下载Genymotion-ARM-Translation.zip

将你的虚拟器运行起来,将下载好的zip包用鼠标拖到虚拟机窗口中,出现确认对跨框点OK就行。然后重启你的虚拟机。

系统环境:

Windows7 64位

问题描述:

自定义View(RemoteViews)无法发出通知,程序报错

错误提示:

android.app.RemoteServiceException: Bad notification posted from packagecom.gdut.repairsystem:Couldn't expand RemoteViewsfor: StatusBarNotification(package=com.gdut.repairsystem id=0 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x10))

解决方案:

在自定义布局中使用了不自持的组件(这里居然是使用了自定义style的原因!!!(最外层的layout不能,里面的可以))

系统环境:

Windows7 64位

问题描述:

jni代码里:Type Method 'NewStringUTF' could not be resolved

错误提示:

Type Method 'NewStringUTF' could not be resolved

解决方案:

点开problems窗口把这条错误删除,ok!

系统环境:

Windows7 64位

问题描述:

intent使用serializable传递复杂数据时报错

错误提示:

Parcelable encountered IOException writing serializable object

解决方案:

在Activity之间传递数据必须所有的内容都实现serializable接口才行

系统环境:

Windows7 64位

问题描述:

intent使用Parcelable传递复杂数据时报错

错误提示:

Unmarshalling unknown type code 7471205 at offset 232

解决方案:

在两个activitiy之间,传递一个实现了Parcelable的ArrayList,就出现了这个错误,但是当我传递其它类型的数据时(int、String)却没有问题,显然问题出现了Parcelable身上,简单找了找答案


系统环境:

Windows7 64位

问题描述:

使用开源控件NumberPicker,inflate时一直错误

错误提示:

Android - Error inflating SimonVT NumberPicker class in my layout xml

解决方案:

activity的主题的numberPickerStyle item(numberpicker的主题)要使用它项目中的主题!坑爹···

<item name="numberPickerStyle">@style/NPWidget.Holo.NumberPicker</item>

系统环境:

Windows7 64位

问题描述:

使用sherlockactionbar创建searchview一直报错

错误提示:

sherlockactionbar Binary XML file line #29: Error inflating class

解决方案:

values-v11等其它资源文件夹里不是使用sherlockactionbar的主题!!!

系统环境:

64位系统,Ubuntu12.04

问题描述:

android环境搭建完毕,但指定了sdk路径没问题依然报错,搭建JDK,Android环境,把android SDK复制过来后,里面的adb和其它命令的都不能使用。

错误提示:

android-sdk-linux_86/platform-tools/adb: 没有那个文件或目录。

android-sdk-linux/platform-tools/adb: 没有那个文件或目录

AndroidSDK/sdk/build-tools/19.0.1/aapt: error while loading shared libraries:

Failed to get the adb version: Cannot run program "/home/android-sdk-linux/platform-tools/adb": error=2, 没有那个文件或目录

解决方案:

由于是64bit的系统,而Android sdk只有32bit的程序,需要安装ia32-libs,才能使用。

运行如下命令:

# sudoapt-get install ia32-libs

SlidingMenu、ActionBarSherLock编译问题

1、新版的SlidingMenu-master需要使用google api编译。

2、SlidingMenu的library编译通过后,把编译好的ActionBarSherLock作为一个library导入SlidingMenu。

导入方法是 右键-properties-android-add-选择ActionBarSherLock,因为SlidingMenu稍后也是以liberary的形式导入自己的项目中,所以此处勾选is a liberary。

3、新建项目,将SlidingMunu作为liberary导入,方法同上。

4、可能报找不到getSupportActionBar等ActionBarSherLock的方法。原因是使用ActionBarSherLock的Activity需继承于SherlockActivity,修改SlidingMenu liberary中的SlidingFragmentActivity,让它继承于SherlockFragmentActivity,重新编译liberary导入。

5、项目红叉或红叹号,删除support_v4包,ActionBarSherLock已包含此包,会冲突。也有可能是主题问题,注意appication theme是否正确,参照exsample。

6、注意把ActionBar、某些Fragment等替换成ActionBarSherLock包中的类。

7、左上角的指示图片是在application theme引用的style里设的。

8、 actionBar.setNavigationMode设置不同模式使用的监听类不同。

系统环境:

64位系统,Ubuntu12.04

问题描述: 真机连接无法识别。 错误提示:

adb devices

List of devices attached
????????????no permissions

解决方案:
1、设置usb权限
$lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 093a:2510 Pixart Imaging, Inc. Hama Optical Mouse
Bus 002 Device 002: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 022: ID0fce:6146 Sony Ericsson Mobile Communications AB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
列表中,Bus 001 Device 022: ID 0fce:6146 Sony Ericsson Mobile Communications AB. 这一行为手机的usb使用端口,记录一下,id为0fce

sudo gedit /etc/udev/rules.d/70-android.rules
加入以下内容:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="6146",MODE="0666"
运行命令,重启udev:
sudo chmod a+rx /etc/udev/rules.d/70-android.rules
sudo service udev restart

2、拔掉usb重新连上再执行:

//重新启动adb server
sudo ./adb kill-server
./adb devices
./adb root

设置完成了
adb devices
List of devices attached
434235313151564C4D45 device

系统环境:

Windows7 64位

问题描述:

AndroidStudio无法更新(已加了google host)

错误提示:

Connection failed. Please check your network connection and try again

解决方案:

修改安装目录下bin\studio.exe.vmoptions文件,如E:\Android\android-studio\bin\studio.exe.vmoptions64位的还有studio64.exe.vmoptions
添加内容:
-Djava.net.preferIPv4Stack=true
-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml
-Didea.patches.url=http://dl.google.com/android/studio/patches/

系统环境:

Windows7 64位

问题描述:

使用Jackson解析key为大写的json(复杂)数据报错

错误提示:

Jackson with JSON: Unrecognized field, not marked as ignorable

解决方案:

1、 给对应的解析实体类加上注解:

@JsonIgnoreProperties(ignoreUnknown = true)

2、在json解析处设置属性

ObjectMapper objectMapper = getObjectMapper();

objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

系统环境:

Windows7 64位 Android Studio 1.0.2

问题描述:

run项目时报错

错误提示:

Error :: duplicate files during packaging of APK

...

解决方案:

在出问题的module的build.gradle中的android节点加上:
packagingOptions {        exclude 'META-INF/DEPENDENCIES'        exclude 'META-INF/LICENSE'        exclude 'META-INF/LICENSE.txt'        exclude 'META-INF/license.txt'        exclude 'META-INF/NOTICE'        exclude 'META-INF/NOTICE.txt'        exclude 'META-INF/notice.txt'        exclude 'META-INF/ASL2.0'    }







更多相关文章

  1. [android]Mac OS环境下真机调试的环境配置
  2. Android
  3. NDK/JNI01--NDK下载配置
  4. 布局使用selector不变色问题
  5. msm8909编译环境搭建
  6. 【android】Eclipse集成android开发环境(IDE)搭建
  7. mybatisplus的坑 insert标签insert into select无参数问题的解决
  8. 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Fedora镜像
  9. 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Debian镜像

随机推荐

  1. ADK的安装
  2. Android下uptime获取系统启动和运行时间
  3. Android 代码风格指南
  4. 必须知道的Android屏幕自适应解决方案
  5. Android篮球计分器App
  6. android中layout区别
  7. 【Android】如何设置应用强制横屏或竖屏
  8. Android 工具类 Toast Log.d()
  9. Android学习路线[转]
  10. Android中Margin和Padding属性知识总结