1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    15
    Vote Rating
    1
    displaced is on a distinguished road

      0  

    Default Unanswered: Sencha, Architect 3, Cordova and Cordova Plugins Help

    Unanswered: Sencha, Architect 3, Cordova and Cordova Plugins Help


    Hi,

    I wondered if anyone would have the time to help me go step-by-step through the process of adding Cordova support and Cordova plugins to a Sencha Touch Architect project?

    I'm trying to use this plugin: https://github.com/wildabeast/BarcodeScanner

    So far, I've tried the following without luck:
    • Created a Sencha Touch project using the MVC template
    • Added Cordova support (sencha cordova init)
    • Changed directory into the new cordova directory and:
    • Run a native build (sencha app build native)
    • Opened the Cordova-generated xcode project and deployed to my iPhone
    At this point, the app runs as expected. So I then go to add some JS code to use the plugin. I'm adding this code to the tap handler in the controller (both of which are auto-generated as part of the MVC template).

    The code I'm adding is a copy of that in the plugin's documentation:


    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);
    }
    );


    However, nothing happens when the button is tapped and I'm not sure where to go from here. I appear to be doing everything by-the-book, but without any luck.

    Any assistance is greatly appreciated!

    Regards,
    Chris

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    15
    Vote Rating
    1
    displaced is on a distinguished road

      1  

    Default


    Ok, I think I've got it!

    I removed everything to do with Sencha and Cmd from my system and removed any PATH entries that related to these. Then reinstalled from scratch and it all seems to work.

    The only wrinkle is that I cannot build within Architect. If I try to perform any device-related builds (simulate on Android, iOS or build iOS/Android app), I get the following in Architect's 'Output' tab:

    [INF] -cordova-platform-add:
    [ERR] The following error occurred while executing this line:/Users/chris/Dropbox/STest/.sencha/app/build-impl.xml:422:
    The following error occurred while executing this line:/Users/chris/Dropbox/STest/.sencha/app/cordova-impl.xml:137:
    The following error occurred while executing this line:jar:file:/Users/chris/bin/Sencha/Cmd/4.0.2.67/sencha.jar!/com/sencha/ant/antlib.xml:616: shellscript returned: 127


    ...but running 'sencha app build native' from the command line appears to work fine. Annoying, but it'll do for the moment.

  3. #3
    Sencha User
    Join Date
    Jun 2014
    Posts
    1
    Vote Rating
    0
    xiaoyuantcm is on a distinguished road

      0  

    Default


    I am also interested in this topic for I am also got into some troubles in a java barcode generator.

  4. #4
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,925
    Answers
    14
    Vote Rating
    63
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    I wonder if Architect is running a different version of Cmd than you are from the command line?

    Both run sencha app build native.
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

Thread Participants: 2

Tags for this Thread