codingdir logo sitemap sitemap |
Home
PHP
C#
C++
ANDROID
JAVA
JAVASCRIPT
PYTHON

phonegap 3.1 BarcodeScanner uncaught module cordova/plugin/BarcodeScanner not found


By : , Category : plugins

Although I've never used older versions as I'm quite new into Phonegap/Cordova, Version 3.1 seems to use a slightly different approach for accessing plugins. Following worked for me with Cordova 3.1 and BarcodeScanner.

Install plugin with

plugman install --platform android --project=DIR-TO-CORDOVA-PROJECT --plugin=https://github.com/wildabeast/BarcodeScanner

You don't have to reference barcodescanner.js by your own, cordova takes care of the includes - the example code from https://github.com/wildabeast/BarcodeDemo worked except I had to change the plugin path from

var scanner = cordova.require("cordova/plugin/BarcodeScanner");

to

var scanner = cordova.require("com.phonegap.plugins.barcodescanner.BarcodeScanner");
ReLated :

I was really dumb and didn't import the barcodescanner.js to the html file

If you wanna build Barcode Scanner try this tutorial form SAP. It works with cordova CLI. i have tried it and it works well.

Finally, I work out it. It is because of Phonegap's version. The version should be above 3.0.

With 3.1, here is what works for me:

Create your project

cordova create example com.example Example

Change to your project directory and then add Android

cd example
cordova platform add android

Get the plugin

cordova plugin add https://github.com/wildabeast/BarcodeScanner.git

Build the project

cordova build android

After that everything appeared to be in the right place.

Comments


Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © codingdir.com All Rights Reserved .