I am using barcodescanner.js to scan the qr code. I have the CaptureActivity android library downloaded and attached to my project
But when I call the following code
window.plugins.barcodeScanner.scan(scannerSuccess, scannerFailure);
Its giving me an error that
Uncaught TypeError: Cannot read property 'barcodeScanner' of undefined at file:///android_asset/www/html/scan.html:83
It was working fine yesterday but giving me an error today. Any thoughts?
In the index.html, are you referencing the right javascript? In my case I had this:
When I should have written this (cordova-xxx instead of phonegap-xxx):
Check in your assets folder and reference the right one. This solved my problem.