You found a bug! We've classified it as SDKTOOLS-896 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User kostysh's Avatar
    Join Date
    Nov 2011
    Location
    Odessa, Ukraine
    Posts
    176
    Vote Rating
    20
    kostysh will become famous soon enough kostysh will become famous soon enough

      0  

    Default Sencha Touch 2.3.1 + Cordova build not working with Ext.device.Connection

    Touch version tested:
    • Touch 2.3.1
    Cordova version:
    • 3.5.0-0.2.6
    • plugin installed: org.apache.cordova.network-information
    Sencha CMD version
    • 5.0.1.231
    • Linux 64
    Desktop
    • Linux 64, Ubuntu 14.04.1
    Device:
    • Huawei Honor w/Android 4.0.3
    Description:
    • Cordova build for Android not works if application use Ext.device.Connection.
      In device console I see one error: Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type at file:///android_asset/www/app.js:1

      If this component (Ext.device.Connection) not required - all fine, no errors, Cordova build working.
    Steps to reproduce the problem:
    • Generate default application
    • Enable Cordova for app by: sencha cordova init [appId] [appName]
    • Edit app.json: section cordova/config/platforms ->android
    • Make Cordova build by: sencha app build native
    • Install apk file from cordova/platforms/ant-build folder -> to device
    • Start the application - all working fine...
    • Install cordova plugin: cordova plugin add org.apache.cordova.network-information
    • Edit app.js: add requires: ['Ext.device.Connection']
    • Edit app.js: add to launch method: alert(Ext.device.Connection.isOnline());
    • Make Cordova build by: sencha app build native
    • Install apk file from cordova/platforms/ant-build folder -> to device
    • Start the application - loader blinking only...
    • See to device console: Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type at file:///android_asset/www/app.js:1
    This issue occur not only on mobile device. If you try to load assets from apk file in Chrome browser - you can see same result.

    UPD: I also tested "production" build (not native) - error occur in browser console. "Testing" build - works fine.

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,996
    Vote Rating
    132
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.
    Workaround comment out following line in ./sencha/app/production.defaults.properties
    Code:
    build.optimize=${build.optimize.enable}

  3. #3

    Default Same bug with Ext.device.Contacts

    Hi,

    I am also experiencing this problem but with Ext.device.Contacts.

    Using:
    Sencha Cmd v5.0.1.231
    Sencha Touch 2.4.0

    Commenting out the build.optimize line also removed the issue for me.

    Is there any update on this?

    Thanks,
    Alex

  4. #4
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    87
    Vote Rating
    15
    info@ferraresegroup.com will become famous soon enough

      0  

    Default

    Same bug on Ext.device.Device

    version: 3.1.0.1943
    channel: 3.1-stable
    platform: 1.4.1.960
    cmd: 5.0.2.270
    framework: Sencha Touch 2.4.x

  5. #5
    Sencha Premium Member
    Join Date
    Aug 2013
    Location
    Brazil
    Posts
    11
    Vote Rating
    1
    renatorro is on a distinguished road

      0  

    Default

    Hello guys,
    I am experiencing a similar issue, but the provided workaround doesn't work.
    When i require the Ext.device.Device, my cordova build for android dowsn't work.
    The following error occurs in the log:
    Code:
    Uncaught TypeError: Cannot read property 'name' of undefined
    I could track the line where the error occurs, and found that it occurs in the Ext.device.device.Cordova class, in the onReady method:

    Code:
        onReady: function() {
            var me = this,
                device = window.device;
            me.name = device.name || device.model;
            me.cordova = device.cordova;
            me.platform = device.platform || Ext.os.name;
            me.uuid = device.uuid;
            me.version = device.version;
            me.model = device.model;
        }
    Looks like window.device is returning null value.
    Someone has any ideas?
    I am stucked here, thanks.

    Sencha Touch 2.4.1
    Cmd 5.1.1
    Cordova 4.2.0

    Regards