I followed official Sencha learning tutorial to setup my first phonegap app with sencha touch give on this link.
And here's my index.html code -
<!DOCTYPE html>
<html>
<head>
<title>Contacts</title>
<script type="text/javascript" src="lib/touch/sencha-touch-debug.js"></script>
<link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet"
type="text/css" />
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="cordova-1.8.1.js"></script>
<script type="text/javascript">
/* Ext.application({
name : "DemoApp",
launch : function() {
console.log("App launch");
}
}); */
</script>
<script type="text/javascript">
document.addEventListener("deviceready", DemoApp.launch, false);
</script>
</head>
<body>
</body>
</html>
And my app/app.js contains -
Ext.application({
name: 'DemoApp',
launch: function() {
this.launched = true;
this.mainLaunch();
},
mainLaunch: function() {
if (!device || !this.launched) {return;}
console.log('mainLaunch');
}
});
All the paths to the script are absolutely correct but still I get following error.
Uncaught ReferenceError: DemoApp is not defined at file:///android_asset/www/index.html:19
I also tried putting app.js in index.html itself but above error still persists. Sencha js and css are included correctly as I'm not getting any error regarding Ext not defined etc etc.
What else could be the reason. Any help is highly appreciated.