【问题标题】:Sencha Touch - after build package is error?Sencha Touch - 构建包后出错?
【发布时间】:2013-08-17 06:18:03
【问题描述】:

在我在命令行中构建包之后:

sencha app build package

当我把网址 localhost/myapp/build/myapp/package

没有加载页面并且有错误信息:

Uncaught TypeError: Cannot call method 'substring' of undefined **app.js** 

这是我的 app.js:

Ext.Loader.setPath({
    'Ext': 'touch/src'
});
//</debug>

Ext.application({
    name: 'Catalog',
    controllers: [
        'Main','Navigation','searchCon'
    ],
    requires: [
        'Ext.MessageBox'
    ],

    views: [
        'Main' , 'Home' , 'Navigation' , 'Viewport' , 'showSearchCategory' , 'SearchQ'
    ],

    icon: {
        '57': 'resources/icons/Icon.png',
        '72': 'resources/icons/Icon~ipad.png',
        '114': 'resources/icons/Icon@2x.png',
        '144': 'resources/icons/Icon~ipad@2x.png'
    },

    isIconPrecomposed: true,

    startupImage: {
        '320x460': 'resources/startup/320x460.jpg',
        '640x920': 'resources/startup/640x920.png',
        '768x1004': 'resources/startup/768x1004.png',
        '748x1024': 'resources/startup/748x1024.png',
        '1536x2008': 'resources/startup/1536x2008.png',
        '1496x2048': 'resources/startup/1496x2048.png'
    },

    launch: function() {
        // Destroy the #appLoadingIndicator element
        Ext.fly('appLoadingIndicator').destroy();

        // Initialize the main view
        Ext.Viewport.add(Ext.create('Catalog.view.Main'));
    },

    onUpdated: function() {
        Ext.Msg.confirm(
            "Application Update",
            "This application has just successfully been updated to the latest version. Reload now?",
            function(buttonId) {
                if (buttonId === 'yes') {
                    window.location.reload();
                }
            }
        );
    }
});

哪里出错了?

我该如何解决我的问题

【问题讨论】:

    标签: sencha-touch


    【解决方案1】:

    习惯这个错误,你会发现很多使用 Sencha。它通常与解析有关。查找不合适的字符,例如列表末尾的逗号,例如 {a,b,c,}。

    可能的重复:

    Uncaught-TypeError-Cannot-call-method-substring-of-undefined-sencha-touch-all.js

    Cannot call method 'substring' of undefined app.js:1 sencha nested

    另见:

    http://www.sencha.com/forum/showthread.php?263159-Uncaught-TypeError-Cannot-call-method-substring-of-undefined-sencha-touch-all.js-3

    【讨论】:

    • 我应该尝试创建应用程序?
    • 当我生成新应用并从中尝试时。这不是错误。我的项目发生了什么
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多