1. #1
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    612
    Vote Rating
    28
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default "sencha app build production" Ext.Loader] Failed loading

    "sencha app build production" Ext.Loader] Failed loading


    The error I am talking about is:
    Code:
    [ERROR] Error thown from your application with message: Error: [Ext.Loader] Failed loading 'sdk/src/data/reader/Array.js', please verify that the file exists
    In dev mode everything works just fine but when you try to compile things, in Sencha Touch 2 projects, with both Windows versions of SDK Tools, command ends like in the upper snippet.

    After many hours I spotted my problem. Maybe yours is the same.

    My application is making use of an authenticatiob api, using Oauth2, so in the early stages, like in application launch, I am checing if the application has an access_token or I have to obtain a new one. That is happening by redirectig the browser to some other url. And this is the point where the sencha sdk tools crash.

    Solution was simple for me, it was enough to delay the eventually redirection some milliseconds, and move it out from launch method.
    Code:
     launch: function() {
            window.FB= this.getController('FB');
            // Destroy the #appLoadingIndicator element
            Ext.fly('appLoadingIndicator').destroy();
            Ext.defer(Ext.bind(this.later,this),200);       
        },
        later:function()
        {
            this.nav = Ext.Viewport.add({xtype:'navigationview'});
    
    
            var params = Ext.Object.fromQueryString(window.location.hash.substr(1));
            if(!params.access_token)
            {
                //init authentication
                FB.authenticate();
            }        
        }
    so better keep the launch method lite and defer the other initialisations otherway the sdk tools might cause you frustrations

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    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


    Little more performant version (food for thought):

    launch : function() {
    var me = this;

    ...

    setTimeout(function() {
    me.later.call(me);
    }, 200);
    },

    later : function() {
    ...
    }
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

Thread Participants: 1