phonegap/phonegap-plugins — Issue #237: Android: barcode-scanner Class Not Found (com.phonegap.plugins.barcodescanner.BarcodeScanner)
Author: pothibo
Created: 2011-11-16 14:34:17+00:00
State: open

I downloaded Eclipse and all the associated tool yesterday. I wanted to use barcode-scanner within an Android application.

I followed all the instruction (using PhoneGap 1.2.0) as expected but when I tried to launch the scanner, it always returned an error saying the Class couldn't be found.

After a few hours spent at understanding what was going on, I found out that com.phonegap.plugins.barcodescanner.BarcodeScanner wasn't included in the src of the project.

It seems that Eclipse only included .java files that lives in src/com/project_name/

One way to fix it is to drag/drop BarcodeScanner.java into the lib folder from "src/com/phonegap/plugins/barcodescanner" and instead of copying it into lib, select the link option.

From there, you should see the java file in the src tree in Eclipse.

Clean install finally made it work.