【问题标题】:Sencha Touch 2 carousel doesn't start on Android deviceSencha Touch 2 轮播无法在 Android 设备上启动
【发布时间】:2014-01-02 13:20:45
【问题描述】:

我使用 Sencha Touch 2.3.X 和 Architect 制作的移动应用程序不想在我的 Android 设备上启动(显示蓝色待定 sencha 屏幕),但它在我的桌面浏览器中运行良好。

这是我的 app.js:

 // @require @packageOverrides
Ext.Loader.setConfig({

});


Ext.application({
    models: [
        'Business'
    ],
    stores: [
        'BusinessStore'
    ],
    views: [
        'MainView',
        'LoginForm',
        'MainNavInterventions',
        'ListContainerInterventions',
        'ListContainerMaintenances',
        'MainNavMaintenances',
        'Carousel',
        'HomeContainer',
        'MainNavHome',
        'DetailPanelView',
        'MainNavPetitstravaux',
        'ListContainerPetitsTravaux'
    ],
    requires: [
        'Ext.MessageBox'
    ],
    controllers: [
        'Account',
        'Business'
    ],
    name: 'Kone',

    launch: function() {

        Ext.create('Kone.view.Carousel', {fullscreen: true});
    }

});

这是我的观点:Carousel.js:

    Ext.define('Kone.view.Carousel', {
    extend: 'Ext.carousel.Carousel',
    alias: 'widget.carousel',

    requires: [
        'Kone.view.MainNavHome',
        'Kone.view.MainNavInterventions',
        'Kone.view.MainNavMaintenances',
        'Kone.view.MainNavPetitstravaux'
    ],

    config: {
        id: 'carousel',
        itemId: 'carousel',
        items: [
            {
                xtype: 'mainnavhome',
                centered: false
            },
            {
                xtype: 'mainnavinterventions'
            },
            {
                xtype: 'mainnavmaintenances',
                itemId: 'mainnavmaintenances'
            },
            {
                xtype: 'mainnavpetitstravaux',
                itemId: 'mainnavpetitstravaux'
            }
        ]
    }

});

这是我的轮播项目视图:

MainNavHome.js:

Ext.define('Kone.view.MainNavHome', {
    extend: 'Ext.navigation.View',
    alias: 'widget.mainnavhome',

    requires: [
        'Kone.view.HomeContainer'
    ],

    config: {
        id: '',
        items: [
            {
                xtype: 'homecontainer',
                title: 'Tableau de bord'
            }
        ]
    }

});

MainNavInterventions.js:

Ext.define('Kone.view.MainNavInterventions', {
    extend: 'Ext.navigation.View',
    alias: 'widget.mainnavinterventions',

    requires: [
        'Kone.view.ListContainerInterventions'
    ],

    config: {
        id: 'mainnavinterventions',
        itemId: 'mainnavinterventions',
        useTitleForBackButtonText: true,
        items: [
            {
                xtype: 'listcontainerinterventions',
                title: 'Interventions'
            }
        ]
    }

});

MainNavMaintenances.js:

Ext.define('Kone.view.MainNavMaintenances', {
        extend: 'Ext.navigation.View',
        alias: 'widget.mainnavmaintenances',

        requires: [
            'Kone.view.ListContainerMaintenances'
        ],

        config: {
            itemId: 'mynavigationview1',
            useTitleForBackButtonText: true,
            items: [
                {
                    xtype: 'listcontainermaintenances',
                    title: 'Maintenances'
                }
            ]
        }

    });

MainNavPetitsTravaux.js:

Ext.define('Kone.view.MainNavPetitstravaux', {
        extend: 'Ext.navigation.View',
        alias: 'widget.mainnavpetitstravaux',

        requires: [
            'Kone.view.ListContainerPetitsTravaux'
        ],

        config: {
            useTitleForBackButtonText: true,
            items: [
                {
                    xtype: 'listContainerPetitsTravaux',
                    title: 'Petits Travaux'
                }
            ]
        }

    });

这是我得到的 Eclipse Android 错误:

01-02 14:18:50.015: D/CordovaActivity(8109): CordovaActivity.init()
01-02 14:18:50.020: D/CordovaWebView(8109): >>> loadUrl(file:///android_asset/www/index.html)
01-02 14:18:50.020: D/PluginManager(8109): init()
01-02 14:18:50.025: D/CordovaWebView(8109): >>> loadUrlNow()
01-02 14:18:50.025: D/Whitelist(8109): Unlimited access to network resources
01-02 14:18:50.030: I/CordovaLog(8109): Found start page location: index.html
01-02 14:18:50.030: I/CordovaLog(8109): Changing log level to DEBUG(3)
01-02 14:18:50.030: D/CordovaActivity(8109): Resuming the App
01-02 14:18:50.030: D/CordovaActivity(8109): CB-3064: The errorUrl is null
01-02 14:18:50.050: D/SoftKeyboardDetect(8109): Ignore this event
01-02 14:18:50.060: D/libEGL(8109): loaded /system/lib/egl/libEGL_mali.so
01-02 14:18:50.065: D/libEGL(8109): loaded /system/lib/egl/libGLESv1_CM_mali.so
01-02 14:18:50.070: D/libEGL(8109): loaded /system/lib/egl/libGLESv2_mali.so
01-02 14:18:50.075: E/(8109): Device driver API match
01-02 14:18:50.075: E/(8109): Device driver API version: 17
01-02 14:18:50.075: E/(8109): User space API version: 17 
01-02 14:18:50.075: E/(8109): mali: REVISION=Linux-r3p1-01rel1 BUILD_DATE=Tue Jul  2 15:06:24 KST 2013 
01-02 14:18:50.115: E/(8109): netstack: LIB_MGR - Error loading lib libdnshostprio.so
01-02 14:18:50.115: E/(8109): netstack: STAT_HUB - Failed to load plugin: libdnshostprio.so
01-02 14:18:50.115: E/(8109): netstack: LIB_MGR - Error loading lib spl_proc_plugin.so
01-02 14:18:50.115: E/(8109): netstack: STAT_HUB - Failed to load plugin: spl_proc_plugin.so
01-02 14:18:50.115: E/(8109): netstack: LIB_MGR - Error loading lib pp_proc_plugin.so
01-02 14:18:50.115: E/(8109): netstack: STAT_HUB - Failed to load plugin: pp_proc_plugin.so
01-02 14:18:50.115: E/(8109): netstack:  STAT_HUB - App com.capgemini.poc.kone isn't supported
01-02 14:18:50.115: D/(8109): dl error message dlopen failed: library "libtcpfinaggr.so" not found
01-02 14:18:50.115: D/Socket_Pool(8109): Failed to create TCP Fin Aggregation interface.
01-02 14:18:50.115: D/Socket_Pool(8109): netstack: CloseUnusedSockets is ON
01-02 14:18:50.115: D/Socket_Pool(8109): netstack: system net.statistics value: 0
01-02 14:18:50.115: D/Socket_Pool(8109): Failed to create TCP Fin Aggregation interface.
01-02 14:18:50.115: D/Socket_Pool(8109): netstack: CloseUnusedSockets is ON
01-02 14:18:50.115: D/Socket_Pool(8109): netstack: system net.statistics value: 0
01-02 14:18:50.120: D/(8109): external/chromium/net/http/http_getzip_factory.cc: Failed to construct GETzip manager, didn't find the library!
01-02 14:18:50.130: D/OpenGLRenderer(8109): Enabling debug mode 0
01-02 14:18:50.160: D/CordovaActivity(8109): onMessage(onPageStarted,file:///android_asset/www/index.html)
01-02 14:18:50.160: D/SoftKeyboardDetect(8109): Ignore this event
01-02 14:18:50.570: D/SoftKeyboardDetect(8109): Ignore this event
01-02 14:18:51.665: D/CordovaWebViewClient(8109): onPageFinished(file:///android_asset/www/index.html)
01-02 14:18:51.665: D/CordovaActivity(8109): onMessage(onPageFinished,file:///android_asset/www/index.html)
01-02 14:18:52.300: D/CordovaLog(8109): file:///android_asset/www/app.js: Line 1 : Uncaught TypeError: Cannot call method 'substring' of undefined
01-02 14:18:52.300: E/Web Console(8109): Uncaught TypeError: Cannot call method 'substring' of undefined at file:///android_asset/www/app.js:1
01-02 14:18:52.310: E/cutils-trace(8109): Error opening trace file: No such file or directory (2)
01-02 14:18:53.670: D/CordovaActivity(8109): onMessage(spinner,stop)
01-02 14:18:53.755: D/TilesManager(8109): Starting TG #0, 0x5905f970
01-02 14:18:53.755: D/TilesManager(8109): new EGLContext from framework: 57a892f8 
01-02 14:18:53.755: D/GLWebViewState(8109): Reinit shader
01-02 14:18:53.820: D/GLWebViewState(8109): Reinit transferQueue

我没有发布我的控制器,因为应用程序不想在禁用我的数据获取时也显示 DOM..

这很奇怪,但是当我将我的 sencha 应用程序复制到 Android Web 服务器并尝试使用 Google Chrome Android 启动我的应用程序时,它可以工作..

可能是我使用 phonegap 生成 sencha 应用程序做得不好,我这样做是为了生成一个 sencha/phonegap 应用程序:

  • “cd”到 Sencha Touch 根文件夹项目和磁带:sencha phonegap init com.mypackagename.myapplicationname MyApplicationName
    • 更改 phonegap.local.properties 中的构建设置(此文件应位于 Sencha Touch 根文件夹中)并设置:phonegap.platform=android
    • 为了生成原生安卓应用:sencha app build native
    • 在 Eclipse 中导入并更改 Assets/www/index.html : phonegap.js by cordova.js

我错了吗?

【问题讨论】:

  • 什么是libtcpfinaggr.so
  • 它与 ROM (cyanogenmod) 相关,它在本地 android web 服务器上运行良好,但在生成的 Android 应用程序中却不行。..

标签: javascript android extjs cordova sencha-architect


【解决方案1】:

解决了重新安装 Sencha CMD 并获取最新版本的 Architect 并使用 WAMP 服务器而不是 Sencha CMD Server..

不好。

【讨论】:

    【解决方案2】:

    修复可能是最新版本的 Architect 适当地包含了一个以前未包含的基类。在浏览器中,应用程序能够延迟加载依赖项,但正如人们所期望的那样,这在设备上不起作用。

    【讨论】:

    • 对于开发人员来说情况很糟糕,使用 Sencha + Cordova 生成的应用程序太糟糕了..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-14
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多