I try to install this phonegap plugin from github, but when I refer the imported project in my project as a library (step 3 in the readme file), i get the error shown above.
Any ideas would be greatly appreciated.
I clicked “ok” instead of “apply” in the library settings, and now it seems to work, the error disapperad.
Can somebody help me with this: When I try to run the project, this is my code in the index.html`s head:
<script type="text/javascript" src="barcodescanner.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript"
document.addEventListener("deviceready", onDeviceReady, false);
}
// PhoneGap is loaded and it is now safe to make calls PhoneGap methods
//
function onDeviceReady() {
window.plugins.barcodeScanner.scan( function(result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
}, function(error) {
alert("Scanning failed: " + error);
}
);
}
</script>
I get the following error:
11-05 12:22:23.641: E/Web Console(454): ReferenceError: Can't find variable: PhoneGap at file:///android_asset/www/barcodescanner.js:57
the file is from the bar code scanner plugin. Its in the correct folder (project/assets/www). Somebody would help with this, would be great.
thanks
I think the issue is that, you have not specified the correct path for your phonegap-XX.js in your maain HTML file.
This is related to : phonegap barcode scanner plugin -> Reference Error