- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone advise what is causing the following error, when I try to do an android build with the imported cordova plugin cordova-barcode-scanner. I am getting the following error when I try to build.
- Error: Plugin "AscertScanner" failed to install.
There is no other information telling me why it has failed.
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
I'm also using the a barcode scanner on an Android device in cordova / XDK.
Why don't you use the intel.xdk.device.scanBarcode()
this works right out of the box, so you don't need 3rd party plugins.
best regards, Jaap (CoSo)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is a build log link on the build page. Can you click on that and get the log and attach here? Also, send the screenshot of your error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
From your previous post I understand that your problem, more than using the plugin methods is the plugin failing to install in an Intel XDK build. Let me see how I can help you. I created a blank project with the barcode scanner plugin. My app built just fine with the plugin installing as it is supposed to. Please see the attached image to refer to the values I have entered when importing the plugin from the web.
Make sure you are not doing any mistakes at this step. If you are not and your project is still failing, I think I can help you narrow down the problem faster if you can zip your projects contents and send it to me via PM (personal message).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anusha,
You solution above solved my problem with the build. It now builds fine. However, I am now back to my original problem of the plugin not working.
I have created a Javascript file which is linked in the normal way through the head section of my index.html. This is the javascript I have tried.
function clickScan() {
cordova.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);
}
);
}
As you can see I have wrapped the suggested code in my own function which is bound to the button that should call the method. It does not work.
What am I doing wrong here? Any help or suggestions would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
I'm also using the a barcode scanner on an Android device in cordova / XDK.
Why don't you use the intel.xdk.device.scanBarcode()
this works right out of the box, so you don't need 3rd party plugins.
best regards, Jaap (CoSo)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
Please check out this simple test app I have attached calling the scan method of the phonegap barcode plugin. I did an android build and tested it on a nexus 5 device and it works.
I have created a button called scan and it is bound to the 'scan' function in js/app.js. app.js is referenced in index.html. On the built app, when you click on scan, it opens up the camera ready to scan a barcode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Anusha,
I got the barcode scanner working using the intel.xdk.devices.barcodescanner. I did do a build with your suggested code and it looks great. I appreciate all your help the the effort you put into building a barcode app for me to refer to.
Regards
Tony Davidson
![](/skins/images/C4F7392A5C68ACA60290C9576F107044/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page