我从http://code.google.com/p/zxing/source/browse/trunk下载了完整的源代码并将其构建到android apk文件中,没有任何问题,但是在我将apk安装到我的手机后,它不起作用,而是显示:“应用程序条形码扫描程序(进程com.google.zxing.client.android)意外停止,请再试一次“
我错过了什么吗?提前谢谢
这是logcat :(抱歉太久了)
08-29 09:45:48.797: E/Trace(652): error opening trace file: No such file or directory (2)
08-29 09:45:49.027: W/dalvikvm(652): VFY: unable to resolve static field 56 (ISSUE_NUMBER) in Lcom/google/zxing/ResultMetadataType;
08-29 09:45:49.027: D/dalvikvm(652): VFY: replacing opcode 0x62 at 0x0017
08-29 09:45:49.048: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.077: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/ResultPoint;)
08-29 09:45:49.077: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/ResultPoint;)
08-29 09:45:49.087: I/dalvikvm(652): Could not find method com.google.zxing.ResultPoint.getX, referenced from method com.google.zxing.client.android.CaptureActivity.drawLine
08-29 09:45:49.097: W/dalvikvm(652): VFY: unable to resolve virtual method 329: Lcom/google/zxing/ResultPoint;.getX ()F
08-29 09:45:49.097: D/dalvikvm(652): VFY: replacing opcode 0x6e at 0x0000
08-29 09:45:49.097: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.107: I/dalvikvm(652): Could not find method com.google.zxing.Result.getResultPoints, referenced from method com.google.zxing.client.android.CaptureActivity.drawResultPoints
08-29 09:45:49.117: W/dalvikvm(652): VFY: unable to resolve virtual method 325: Lcom/google/zxing/Result;.getResultPoints ()[Lcom/google/zxing/ResultPoint;
08-29 09:45:49.117: D/dalvikvm(652): VFY: replacing opcode 0x6e at 0x0003
08-29 09:45:49.127: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.157: I/dalvikvm(652): Could not find method com.google.zxing.Result.toString, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecodeExternally
08-29 09:45:49.157: W/dalvikvm(652): VFY: unable to resolve virtual method 328: Lcom/google/zxing/Result;.toString ()Ljava/lang/String;
08-29 09:45:49.167: D/dalvikvm(652): VFY: replacing opcode 0x74 at 0x0057
08-29 09:45:49.167: I/dalvikvm(652): Could not find method com.google.zxing.Result.getText, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecodeExternally
08-29 09:45:49.177: W/dalvikvm(652): VFY: unable to resolve virtual method 326: Lcom/google/zxing/Result;.getText ()Ljava/lang/String;
08-29 09:45:49.177: D/dalvikvm(652): VFY: replacing opcode 0x74 at 0x014d
08-29 09:45:49.187: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.207: I/dalvikvm(652): Could not find method com.google.zxing.Result.getBarcodeFormat, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecodeInternally
08-29 09:45:49.207: W/dalvikvm(652): VFY: unable to resolve virtual method 322: Lcom/google/zxing/Result;.getBarcodeFormat ()Lcom/google/zxing/BarcodeFormat;
08-29 09:45:49.207: D/dalvikvm(652): VFY: replacing opcode 0x74 at 0x004c
08-29 09:45:49.247: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.277: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.277: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.287: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.297: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.307: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.307: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.317: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.328: I/dalvikvm(652): Could not find method com.google.zxing.Result.getText, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecode
08-29 09:45:49.328: W/dalvikvm(652): VFY: unable to resolve virtual method 326: Lcom/google/zxing/Result;.getText ()Ljava/lang/String;
08-29 09:45:49.328: D/dalvikvm(652): VFY: replacing opcode 0x6e at 0x0061
08-29 09:45:49.337: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.349: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.349: W/dalvikvm(652): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
08-29 09:45:49.397: W/dalvikvm(652): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/zxing/client/android/CaptureActivity;
08-29 09:45:49.397: W/dalvikvm(652): Class init failed in newInstance call (Lcom/google/zxing/client/android/CaptureActivity;)
08-29 09:45:49.397: D/AndroidRuntime(652): Shutting down VM
08-29 09:45:49.407: W/dalvikvm(652): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-29 09:45:49.439: E/AndroidRuntime(652): FATAL EXCEPTION: main
08-29 09:45:49.439: E/AndroidRuntime(652): java.lang.ExceptionInInitializerError
08-29 09:45:49.439: E/AndroidRuntime(652): at java.lang.Class.newInstanceImpl(Native Method)
08-29 09:45:49.439: E/AndroidRuntime(652): at java.lang.Class.newInstance(Class.java:1319)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.os.Looper.loop(Looper.java:137)
08-29 09:45:49.439: E/AndroidRuntime(652): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-29 09:45:49.439: E/AndroidRuntime(652): at java.lang.reflect.Method.invokeNative(Native Method)
08-29 09:45:49.439: E/AndroidRuntime(652): at java.lang.reflect.Method.invoke(Method.java:511)
08-29 09:45:49.439: E/AndroidRuntime(652): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-29 09:45:49.439: E/AndroidRuntime(652): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-29 09:45:49.439: E/AndroidRuntime(652): at dalvik.system.NativeStart.main(Native Method)
08-29 09:45:49.439: E/AndroidRuntime(652): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
08-29 09:45:49.439: E/AndroidRuntime(652): at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:103)
08-29 09:45:49.439: E/AndroidRuntime(652): ... 15 more
答案 0 :(得分:1)
当然可行:https://play.google.com/store/apps/details?id=com.google.zxing.client.android
您修改了应用程序,导致崩溃,或者您正在通过手动侧载无法运行应用程序的设备上进行安装。
如果没有提供最重要的信息,您将无法获得任何进一步的帮助:堆栈跟踪!