Hi, and you're welcome. I should have asked which
version of PhoneGap you are using. In any case,
make sure you are pulling the corresponding repo
from github, that is to say refer to the
tutorial for the
different versions of phonegap-plugins on github.
I believe you have made the right changes, but see my
summary below from two projects I have created and
tested with two different versions.
PhoneGap 1.4.1, BarcodeScanner.java:
package com.phonegap.plugins.barcodescanner;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;
PhoneGap 1.5.0+ (e.g. Cordova 1.6.1), BarcodeScanner.java:package com.phonegap.plugins.barcodescanner;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
You may have mixed the versions. The
barcodescanner.jsthat goes with PhoneGap 1.5.0+ will have a line like this in it (new way):
cordova.exec(successCallback, errorCallback, 'BarcodeScanner', 'scan', []);
PhoneGap 1.4.1 will have a line like this in it (old way):
PhoneGap.exec(successCallback, errorCallback, 'BarcodeScanner', 'scan', []);
Libby