Bare minimum set up for PhoneGap/Cordova development on Linux using PhoneGap Build -


so played little phonegap 3 years ago. writing basic html , javascript , pushing github repo. phonegap build pull repo , build me apk install phone.

fast forward 3 years , node has been introduced make process little slicker.

except modified hello world app include button barcode scan using:

phonegap plugin add com.phonegap.plugins.barcodescanner 

and tried use barcode scanner adding button following onclick event (added pre-existing app object):

buttonpressed: function() {     alert("clicked");     cordova.plugins.barcodescanner.scan(         function (result) {           alert("we got barcode\n" +                 "result: " + result.text + "\n" +                 "format: " + result.format + "\n" +                 "cancelled: " + result.cancelled);         },          function (error) {           alert("scanning failed: " + error);         }     ); } 

if use phonegap developer app on android phone first alert, nothing else. if use phonegap build apk bunch of failing specs in jasmine, e.g.

cordova.require object should exist barcodescanner plugin should exist.  module cordova/plugin/barcodescanner not found  cordova.require object should exist should contain scan function.  cordova.require object should exist should contain encode function.  cordova.require object should exist should contain 3 destinationtype constants. 

i haven't added platforms local development because wasn't planning on building there. plus i'm on linux can't add ios platform if want to.

can please tell me i'm doing wrong?

you forgot include cordova.js file. need build cordova project everytime changes.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -