1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    0
    hotrod is on a distinguished road

      0  

    Default app build with phonegap and navigator failing

    Can't find anything on this yet. I'm trying to use 'sencha app build' on my project that uses phonegap apis and i get an error when the build tool finds any calls to phonegap apis like 'navigator.network'.

    [INFO] Resolving your application dependencies...
    [ERROR] Error thown from your application with message: TypeError: 'undefined' is not an object

    Is there the equivalent of a header file for phonegap that i need to inform the sencha tool about?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,546
    Vote Rating
    1120
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default

    The build will use the native wrapper that comes with ST. PhoneGap isn't an option to build for.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User siebmanb's Avatar
    Join Date
    Aug 2011
    Location
    Geneva (CH) - Grenoble (FR)
    Posts
    253
    Vote Rating
    16
    siebmanb will become famous soon enough

      0  

    Default

    I had the same issue. The solution is to test that this call is possible before doing it, and if not exit the function with something like that :

    Code:
    if (!
    navigator.network) return false;
    Twitter account @siebmanb.
    Co-founder & CEO at ButterflyEffect.
    Mobile application developer using Sencha Touch and Phonegap for iOS, Android and webapp.

Thread Participants: 2