关于java.lang.verifyerror 原因和解决方法:

log 日志(大概是这样的):
06-05 02:58:27.661: W/dalvikvm(977): VFY: unable to resolve static field 87 (D8) in Ltw/com/google/zixing/WriteException/WriteExceptionzixing$DataBits;
06-05 02:58:27.661: D/dalvikvm(977): VFY: replacing opcode 0x62 at 0x0007
06-05 02:58:27.701: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.isConnected, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.openUsbSerial
06-05 02:58:27.701: W/dalvikvm(977): VFY: unable to resolve virtual method 131: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.isConnected ()Z
06-05 02:58:27.701: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x000f
06-05 02:58:27.751: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.isConnected, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.readDataFromSerial
06-05 02:58:27.751: W/dalvikvm(977): VFY: unable to resolve virtual method 131: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.isConnected ()Z
06-05 02:58:27.751: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x0017
06-05 02:58:27.751: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.isConnected, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.writeDataToSerial
06-05 02:58:27.751: W/dalvikvm(977): VFY: unable to resolve virtual method 131: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.isConnected ()Z
06-05 02:58:27.751: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x000e
06-05 02:58:27.801: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.isConnected, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.SetNewVIDPID
06-05 02:58:27.801: W/dalvikvm(977): VFY: unable to resolve virtual method 131: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.isConnected ()Z
06-05 02:58:27.831: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x0027
06-05 02:58:27.831: E/dalvikvm(977): Could not find class 'com.google.zixing.WriteException.WriteExceptionzixing', referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.onCreate
06-05 02:58:27.881: I/dalvikvm(977): threadid=3: reacting to signal 3
06-05 02:58:27.881: W/dalvikvm(977): VFY: unable to resolve new-instance 77 (Ltw/com/google/zixing/WriteException/WriteExceptionzixing;) in Lcom/google/WriteExceptionhxdsimpletest/WriteExceptionHXDSimpleTest;
06-05 02:58:27.881: D/dalvikvm(977): VFY: replacing opcode 0x22 at 0x009d
06-05 02:58:27.921: I/dalvikvm(977): Wrote stack traces to '/data/anr/traces.txt'
06-05 02:58:27.941: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.end, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.onDestroy
06-05 02:58:27.941: W/dalvikvm(977): VFY: unable to resolve virtual method 129: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.end ()V
06-05 02:58:27.941: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x000d
06-05 02:58:27.951: I/dalvikvm(977): Could not find method com.google.zixing.WriteException.WriteExceptionzixing.isConnected, referenced from method com.google.WriteExceptionhxdsimpletest.WriteExceptionHXDSimpleTest.onResume
06-05 02:58:27.951: W/dalvikvm(977): VFY: unable to resolve virtual method 131: Ltw/com/google/zixing/WriteException/WriteExceptionzixing;.isConnected ()Z
06-05 02:58:27.991: D/dalvikvm(977): VFY: replacing opcode 0x6e at 0x0029
06-05 02:58:27.991: D/dalvikvm(977): DexOpt: unable to opt direct call 0x007e at 0xa9 in Lcom/google/WriteExceptionhxdsimpletest

首先是类包的问题,右键项目 -> 选择Properties -> Java Build Path -> Source ->Add Folder... -> 勾选libs ok!

这时候有可能会出现另一个问题:
Unable to execute dex: Multiple dex files define...
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define...

如果出现这个问题,这样解决:
右键项目 -> 选择Properties -> Java Build Path -> Order and Export -> 取消勾选libs中重复的JAR包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值