Search code examples
visual-studiocordovawindows-phone-8sencha-touch-2sencha-architect

Sencha Touch with WindowsPhone8: Ext.Loader Failed loading file


I'm building a WindowsPhone8 app using sencha touch and cordova.

The app works fine on the browser, but as I'm trying to deploy it to the device, I'm getting an error:

[Ext.Loader] Failed loading 'app/view/xxxx.js', please verify that the file exists file:x-wmapp0:www/touch/sencha-touch-all.js Line:8527

almost for all my views, controllers, models and stores.

I tried the solution from http://www.sencha.com/forum/showthread.php?267351-Getting-Error-in-PhoneGap-Ext.Loader-Failed-loading-app-view-Main.js&p=979743 i.e. add disableCaching config to false

Ext.Loader.setConfig({
    disableCaching: false 
});

But no luck. I'm still getting this issue.

Just for more information's sake, I generated a cordova project using CordovaWP8 project template for Visual Studio. I just test run some code to verify if sencha touch and cordova are working together. After that I built majority of my project in Sencha Architect, and now I'm putting it all together in Visual Studio.

Any ideas anyone?


Solution

  • Figured out the issue.

    The following things need to be ensured

    Ext.Loader.setConfig({
        enabled:true,          // important
        disableCaching: false, // important
        paths: {
            "Ext": 'touch/src',
        }
    });
    

    Another and bigger issue was that I had not included the controllers, views, stores and models (which I had mentioned in my app.js file in my Visual studio project, which looks something like this:

    Files not included in the project

    So, I had to include all the files that shall be loaded in the project by right clicking on them and "Include file in project", which looks something like this.

    Now my project works like charm. Well not charm, in the end the WebView is IE :P

    Files included in the project