Eclipse for Mobile Developers
Version: Juno Release
Build id: 20120614-1722
ANDROID-SDK2.3.3版本编译ZXING2.0里面的ANDROID目录的例子,没任何改动编译通过,但是在手机运行就出错。
core.jar也是原目录的文件。Logcat文件如下:
09-24 03:21:13.191: W/dalvikvm(7310): threadid=1: thread exiting with uncaught exception (group=0x40018560)
09-24 03:21:13.203: E/AndroidRuntime(7310): FATAL EXCEPTION: main
09-24 03:21:13.203: E/AndroidRuntime(7310): java.lang.ExceptionInInitializerError
09-24 03:21:13.203: E/AndroidRuntime(7310):  at java.lang.Class.newInstanceImpl(Native Method)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at java.lang.Class.newInstance(Class.java:1440)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.Instrumentation.newActivity(SourceFile:1056)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.ActivityThread.performLaunchActivity(SourceFile:1643)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.ActivityThread.handleLaunchActivity(SourceFile:1753)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.ActivityThread.access$1500(SourceFile:155)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.ActivityThread$H.handleMessage(SourceFile:993)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.os.Handler.dispatchMessage(SourceFile:130)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.os.Looper.loop(SourceFile:329)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at android.app.ActivityThread.main(SourceFile:3820)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at java.lang.reflect.Method.invokeNative(Native Method)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at java.lang.reflect.Method.invoke(Method.java:538)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(SourceFile:901)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at com.android.internal.os.ZygoteInit.main(SourceFile:659)
09-24 03:21:13.203: E/AndroidRuntime(7310):  at dalvik.system.NativeStart.main(Native Method)
09-24 03:21:13.203: E/AndroidRuntime(7310): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
09-24 03:21:13.203: E/AndroidRuntime(7310):  at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:107)
09-24 03:21:13.203: E/AndroidRuntime(7310):  ... 15 more

解决方案 »

  1.   

    09-24 03:21:13.203: E/AndroidRuntime(7310): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
    ResultMetadataType 这个类没找到,检查下是不是有的库什么的没有下载
      

  2.   

    09-24 03:21:13.203: E/AndroidRuntime(7310): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
    ResultMetadataType 这个类没找到,检查下是不是有的库什么的没有下载