Question

I'm trying to use the barcode scanner plugin for PhoneGap. I've followed the instructions in the readme, but the PhoneGap app simply crashes when I call window.plugins.barcodeScanner.scan():

E/AndroidRuntime(15842): java.lang.RuntimeException: Unable to instantiate
activity ComponentInfo{mypackage/com.google.zxing.client.android.CaptureActivity}:
java.lang.ClassNotFoundException: com.google.zxing.client.android.CaptureActivity

I suspect this has something to do with the fact that after I add a reference to the plugin's LibraryProject, it doesn't actually stick. When I go to my project's properties, Android, I can add a reference to the BarcodeScanner\LibraryProject:

Reference successfully added to project

But after I click Apply and OK and then reopen the project's properties, the reference has a red X:

Reference error!

What's going on here?

Was it helpful?

Solution 3

I ended up just calling out to the installed Barcode Scanner app rather than trying to include the code as a part of my project.

OTHER TIPS

Have you tried upgrading eclipse? i was having some issues with eclipse not loading all files, i had to run eclipse as administrator in windows 7 and upgraded, this took care of my issue.

I have done a work around for this problem.Instead of importing BarCode Library project to eclipse, create new project and add packages and class files manually. Then build the library project without error.After that you can add this library to your project and scan function will work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top