我尝试了Phonegap和Barcodescanner。
http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3
“scanCode”点击链接。 然后退出并显示Android应用程序错误。
日志如下。有什么不对。
> 12-13 10:55:32.486: E/AndroidRuntime(3726): FATAL EXCEPTION: main
> 12-13 10:55:32.486: E/AndroidRuntime(3726):
> java.lang.RuntimeException: Unable to instantiate activity
> ComponentInfo{com.myapp/com.google.zxing.client.android.encode.EncodeActivity}:
> java.lang.ClassNotFoundException:
> com.google.zxing.client.android.encode.EncodeActivity in loader
> dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk] 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1608)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1702)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.ActivityThread.access$1500(ActivityThread.java:117) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:949)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> android.os.Handler.dispatchMessage(Handler.java:99) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> android.os.Looper.loop(Looper.java:123) 12-13 10:55:32.486:
> E/AndroidRuntime(3726): at
> android.app.ActivityThread.main(ActivityThread.java:3728) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> java.lang.reflect.Method.invokeNative(Native Method) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> java.lang.reflect.Method.invoke(Method.java:507) 12-13 10:55:32.486:
> E/AndroidRuntime(3726): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> dalvik.system.NativeStart.main(Native Method) 12-13 10:55:32.486:
> E/AndroidRuntime(3726): Caused by: java.lang.ClassNotFoundException:
> com.google.zxing.client.android.encode.EncodeActivity in loader
> dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk] 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:551) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:511) 12-13
> 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.Instrumentation.newActivity(Instrumentation.java:1021)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1600)
> 12-13 10:55:32.486: E/AndroidRuntime(3726): ... 11 more
答案 0 :(得分:2)
听起来您没有正确设置库项目。这是一篇关于正确设置的博客文章。
http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html