嗨,我是android的初学者。我想编写一个集成了 zxing 条码扫描器的 android 应用程序。我使用这个网站来集成功能:
一切正常,但如果我说我想用我的扫描仪打开应用程序,应用程序就会崩溃。
如果我使用已安装的条形码扫描仪一切正常...
LogCat 说:
04-28 19:05:53.566: E/AndroidRuntime(11666): FATAL EXCEPTION: main
04-28 19:05:53.566: E/AndroidRuntime(11666): java.lang.ExceptionInInitializerError
04-28 19:05:53.566: E/AndroidRuntime(11666): at java.lang.Class.newInstanceImpl(Native Method)
04-28 19:05:53.566: E/AndroidRuntime(11666): at java.lang.Class.newInstance(Class.java:1319)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1984)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.ActivityThread.access$600(ActivityThread.java:132)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.os.Handler.dispatchMessage(Handler.java:99)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.os.Looper.loop(Looper.java:137)
04-28 19:05:53.566: E/AndroidRuntime(11666): at android.app.ActivityThread.main(ActivityThread.java:4575)
04-28 19:05:53.566: E/AndroidRuntime(11666): at java.lang.reflect.Method.invokeNative(Native Method)
04-28 19:05:53.566: E/AndroidRuntime(11666): at java.lang.reflect.Method.invoke(Method.java:511)
04-28 19:05:53.566: E/AndroidRuntime(11666): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
04-28 19:05:53.566: E/AndroidRuntime(11666): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
04-28 19:05:53.566: E/AndroidRuntime(11666): at dalvik.system.NativeStart.main(Native Method)
04-28 19:05:53.566: E/AndroidRuntime(11666): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
04-28 19:05:53.566: E/AndroidRuntime(11666): at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:101)
04-28 19:05:53.566: E/AndroidRuntime(11666): ... 15 more