-
15 Oct 2012 9:45 PM #1
Sencha Touch 2.1.0rc2 and PhoneGap 2.1.0 does not startup
Sencha Touch 2.1.0rc2 and PhoneGap 2.1.0 does not startup
I have the following problem while starting the app. It does not occur in ST 2.1.0rc1.<br>
<br>
<strong>2012-10-16 01:32:13.292 KICKBAK[64098:1dc03] Multi-tasking -> Device: YES, App: YES</strong><br>
<strong>2012-10-16 01:32:13.990 KICKBAK[64098:1dc03] [INFO] Ext.device.connection.PhoneGap</strong><br>
<strong>2012-10-16 01:32:13.990 KICKBAK[64098:1dc03] [INFO] Phone is Online</strong><br>
<strong>2012-10-16 01:32:14.004 KICKBAK[64098:1dc03] [INFO] appInit - start</strong><br>
<strong>2012-10-16 01:32:14.013 KICKBAK[64098:1dc03] [INFO] Error on Line#18</strong><br>
<strong>Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.event.publisher.Dom</strong><br>
<strong>2012-10-16 01:32:14.014 KICKBAK[64098:1dc03] [INFO] Cordova Facebook Connect plugin initialized successfully.</strong><br>
<strong>2012-10-16 01:32:14.984 KICKBAK[64098:1dc03] [INFO] Ext.device.connection.PhoneGap</strong><br>
<strong>2012-10-16 01:32:14.984 KICKBAK[64098:1dc03] [INFO] Phone is Online<br>
<br>
</strong>I'm using sencha-touch-all.js, but yet, it's asking for classes that exists within that file?!?!?<br>
<br>
My index.html is<br>
<br>
<font size="1"><html><br>
...<br>
</font><font size="1"> <!--</font><br>
<font size="1"> Phone Gap Libs</font><br>
<font size="1"> --></font><br>
<font size="1"> <script type="text/javascript" src="lib/cordova-2.1.0.ios.js"></script></font><br>
<font size="1"> <!-- Debug Javascript on mobile browser --></font><br>
<font size="1"> <script type="text/javascript" src="lib/sencha-touch-all.js"></script><br>
</font><font size="1"> <script type="text/javascript"></font><br>
var _appPath = "app", _extPath = 'lib/sencha-touch-2.1.0-rc2/src';<br>
<font size="1"> var _appId = "xxxxxx";</font><br>
<font size="1"> Ext.Loader.setConfig(</font><br>
<font size="1"> {</font><br>
<font size="1"> enabled : false,</font><br>
<font size="1"> paths :</font><br>
<font size="1"> {</font><br>
<font size="1"> Ext : _extPath,</font><br>
<font size="1"> Genesis : _appPath</font><br>
<font size="1"> }</font><br>
<font size="1"> });</font><br>
function onBodyLoad()<br>
<font size="1"> {</font><br>
<font size="1"> document.addEventListener("online", function()</font><br>
<font size="1"> {</font><br>
<font size="1"> if (Ext.device)</font><br>
<font size="1"> {</font><br>
<font size="1"> console.log(Ext.device.Connection.__proto__.$className)</font><br>
}<br>
<font size="1"> console.log("Phone is Online");</font><br>
<font size="1"> }, false);</font><br>
document.addEventListener("deviceready", onDeviceReady, false);<br>
<font size="1"> }</font><br>
<font size="1"> function onDeviceReady()</font><br>
<font size="1"> {</font><br>
<font size="1"> console.debug = console.debug || console.log;</font><br>
<font size="1"> console.warn = console.warn || console.debug;</font><br>
<font size="1"> console.log("appInit - start");</font><br>
Ext.application(...);<br>
<font size="1"> console.log("appInit - end");</font><br>
<font size="1"> }</font><br>
<font size="1"> </script></font><br>
</head><br>
<font size="1"> <body onload="onBodyLoad()"></font><br>
<script type="text/javascript"><br>
<font size="1"> window.onerror = function(msg, url, linenum)</font><br>
<font size="1"> {</font><br>
<font size="1"> console.log("Error on Line#" + linenum + "\n" + msg);</font><br>
<font size="1"> }</font><br>
<font size="1"> </script></font><br>
</body><br>
<font size="1"></html></font>
-
16 Oct 2012 5:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
HTML is not allowed on the forum, can you please clean this up so it's legible?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Oct 2012 7:19 AM #3
Sorry for the inconvenience
Sorry for the inconvenience
REQUIRED INFORMATIONExt version tested:
- ST 2.1.0 rev r2
- iOS5, iOS6
- html
- I'm getting complains from the Ext.Loader that some Ext Core classes are missing eventhough I used sencha-touch-all.js from your pre-compile library.
- No problems were found when running on Desktop (Safari/Chrome)
- Load up ST2.1.0r2 and PhoneGap 2.1.0 on iOS5/6 device
- Application should launch as expected, just like ST2.1.0r1
- Ext.Loader complains about Ext.event.publisher.Dom class is missing, amongst others ...
- The only workaround is to include all source files under /src and enabled dynamic loading.
Code:<!DOCTYPE html> <html> <head> .... <script type="text/javascript" src="lib/cordova-2.1.0.ios.js"></script> <script type="text/javascript" src="lib/sencha-touch-all.js"></script> ..... <script type="text/javascript"> var _appPath = "app", _extPath = 'lib/sencha-touch-2.1.0-rc2/src'; Ext.Loader.setConfig( { enabled : false, paths : { Ext : _extPath, Genesis : _appPath } }); function onBodyLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { Ext.application(...); } </script> <body onload="onBodyLoad()"> </body> </html>
HELPFUL INFORMATIONScreenshot or Video:
2012-10-16 01:37:37.939 KICKBAK[64530:1dc03] Multi-tasking -> Device: YES, App: YES
2012-10-16 01:37:38.330 KICKBAK[64530:1dc03] [INFO] Ext.device.connection.PhoneGap
2012-10-16 01:37:38.330 KICKBAK[64530:1dc03] [INFO] Phone is Online
2012-10-16 01:37:38.344 KICKBAK[64530:1dc03] [INFO] appInit - start
2012-10-16 01:37:38.354 KICKBAK[64530:1dc03] [INFO] Error on Line#18
Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.event.publisher.Dom
2012-10-16 01:37:39.329 KICKBAK[64530:1dc03] [INFO] Ext.device.connection.PhoneGap
2012-10-16 01:37:39.329 KICKBAK[64530:1dc03] [INFO] Phone is Online
See this URL for live test case: http://Debugging already done:- none
- Enabled Dynamic loading, but not very feasible in deployment environment.
- ext-all.css
- custom css (included customized theme for my app, but not relevant to the testcase)
- iOS5.1
- iOS6
-
16 Oct 2012 7:45 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
First thing that catches my eye is ST2 is smart enough to know when it is within PhoneGap and therefore no need to listen for the deviceready event
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Oct 2012 8:01 AM #5
The deviceReady event is used by PhoneGap to let the web app know that PhoneGap have finished initializing and ready to receive calls.
Once that happens, I can initialize ST to load the app, so any calls to PhoneGap will not result in exceptions or errors.
Is that something you guys can test? Because the problems happens on the Simulator as well.
Thanks!
-
16 Oct 2012 9:11 AM #6
Hi !
I'm fighting too with Cordova & Sencha. Just one question, where does 'lib/sencha-touch-2.1.0-rc2/src'; point to? to the app.js?
Just one more thing erchan, could you please send me a basic www structure with cordova and sencha that works with rc1. I'm starting to get desperate..
Many Thanks !
-
16 Oct 2012 9:50 AM #7
It's basically where I extract the binary from the download. "src" is where all the uncompressed source files are located, not the sencha-touch-all.js files.
I use the Loader to enable/disable dynamic loading. For developement, I enable it, for production, I use the minified version.
Are you having the exact same problem? I don't know what to make of it. It doesn't seem to make any sense.
-
16 Oct 2012 10:41 PM #8
After going thru a ton of debugging, it appears that the inclusion of
Ext.device.*
Within sencha-touch-all*.js broke the load.
The native API requires that PhoneGap is already instantiated when the singleton classes are loaded. But that is not possible since we have to wait for the deviceReady event from PhoneGap for it to happen.
As such, it is causing the file sencha-touch-all*.js to not be able to complete its loading process.
If you could kindly remove those Native API and put it into a separate JS (2.1GA?), that would be great.
sencha-touch-native-all.js (?)
Thank you.
-
15 Nov 2012 7:27 PM #9
erchan_2000, can you please advise how you got it working with dynamic loading enabled? I just tried your solution and I'm still getting a blank screen after the phonegap splash. FYI, i'm using PhoneGap 2.1 and Sencha Touch 2.1
-
16 Nov 2012 3:27 PM #10
Interesting
Interesting
A lot of people (myself included) are having the PhoneGap Build + ST2.1 = white screen broken app problem.
In fact, there is a large discussion about it here: http://www.sencha.com/forum/showthre...-ST-2.1./page5
So far, the Sencha guys are being pretty quiet about it.
Has it effectively been narrowed down to the Ext.device.* references that weren't present in ST2.0 that are now present in ST2.1?
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote