I have a Sencha Touch 2.1 / Cordova 2.0 application for Android that seems to not include my own Javascript files correctly. In my app.js I make a call like so:
Code:
CustomJS.exampleFunction();
which is supposed to call the function in a CustomJS.js file that lools like so:
Code:
var CustomJS= {
exampleFunction: function(){
return cordova.exec(function(data){}, function(data){}, "ExamplePlugin", "aFunction", []);
}
};
But when I launch my application on the device I get this error in the logcat:
Code:
ERROR/Web Console(9933): Uncaught TypeError: Object function () {
... ...
} has no method 'exampleFunction' at file:///android_asset/www/app.js
Here is the js part of the app.json I used to build my sencha app:
Code:
"js": [
{
"path": "cordova-2.0.0.js"
},
{
"path": "lib/CustomJS.js"
},
{
"path": "touch/sencha-touch.js"
},
{
"path": "app.js",
"bundle": true,
"update": "delta"
}
]
I have looked everywhere I could to find something that would explain why I can't access my CustomJSvariable in my app.js but didn't find anything.
Does anyone know if I'm doing anything wrong? Or is there a simpler/better way to achieve that?
(The same configuration works on iOS)