-
28 Feb 2012 11:46 PM #1
SDK 2 beta with ST2beta: creating own build; error with required classes
SDK 2 beta with ST2beta: creating own build; error with required classes
Hello,
I'm trying to assemble my own build.
I created my jsb file with:
and the app-all.js and all-classes.js with:Code:sencha create jsb -a index.orig.html -p project.jsb3
But when I open my app which looks adjusted now:Code:sencha build -v -c -p project.jsb3 -d ./
I got an error-message because of my required classes:HTML Code:<!DOCTYPE html><html><head> <title>App</title> <link rel="stylesheet" href="lib/touch/resources/css/sencha-touch.css" type="text/css"> <link rel="stylesheet" href="css/styles.css" type="text/css"> <script src="http://192.168.1.106:9999/socket.io/socket.io.js"></script> <script src="http://192.168.1.106:9999/socket.io/socket.io-sessions.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&v=3&libraries=geometry"></script> <script type="text/javascript" src="lib/touch/sencha-touch.js"></script> <script type="text/javascript" src="app-all.js"></script> <script type="text/javascript" src="app.js"></script> </head><body></body></html>
Shouldn't the sencha sdk tools arrange the order of my classes in the app-all.js, that the required classes are loaded, when necessary? When I remove the requires attribute of my classes in the generated app-all.js, I do not get these error message (but are confronted by other errors *g*).Code:Uncaught Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required classes: TouchTest.view.Startscreen.Search, TouchTest.view.Startscreen.Register, TouchTest.view.Startscreen.Login, TouchTest.view.Startscreen.RequestPassword
Is there a new adjusted version of the HowTo "Create your own build" with the SDK Tools 2 beta?
Thanks!
Sebastian
-
29 Feb 2012 7:36 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
You should use sencha-touch-debug.js
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.
-
29 Feb 2012 7:46 AM #3
Thanks for the hint. I will try it tomorrow an will report!
Cheers
-
1 Mar 2012 4:05 AM #4
Hey,
I tried to replace the sencha-touch.js file with the sencha-touch-debug.js file in my updated application.
But this does not work either. The "creating own build" - guide states that the "source" html-file should refer to the sencha-touch-debug.js script and the new one, the updated html-file for the production-mode should include the sencha-touch.js.
So, the references look good. But the application for the production-mode throws still the error
Any more ideas?Code:Uncaught Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required classes: ...
Thanks.
-
1 Mar 2012 4:35 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
When you are doing the build, you aren't in "production mode". After the build you should switch to sencha-touch.js
sencha-touch.js doesn't have Ext.Loader enabled where sencha-touch-debug.js does and Ext.Loader is crucial to the SDK Tools.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.
-
1 Mar 2012 5:47 AM #6
Yes, that's exactly the way, I understood it as well.
My index.orig.html file, which is used for the build looks like:
With this, I can open my app and create the app-all.js and all-classes.js without errors.HTML Code:<!DOCTYPE html> <html> <head> <title>App</title> <link rel="stylesheet" href="lib/touch/resources/css/sencha-touch.css" type="text/css"> <link rel="stylesheet" href="css/styles.css" type="text/css"> <script src="http://192.168.1.106:9999/socket.io/socket.io.js"></script> <script src="http://192.168.1.106:9999/socket.io/socket.io-sessions.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&v=3&libraries=geometry"></script> <script type="text/javascript" src="lib/touch/sencha-touch-debug.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body> </body> </html>
When I open then my app with the new created app-all.js, I got these mentioned errors.
The html-file for the "production mode" looks like:
So, only the HTML file for the production mode includes the sencha-touch.js.HTML Code:<!DOCTYPE html> <html> <head> <title>App</title> <link rel="stylesheet" href="lib/touch/resources/css/sencha-touch.css" type="text/css"> <link rel="stylesheet" href="css/styles.css" type="text/css"> <script src="http://192.168.1.106:9999/socket.io/socket.io.js"></script> <script src="http://192.168.1.106:9999/socket.io/socket.io-sessions.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&v=3&libraries=geometry"></script> <script type="text/javascript" src="lib/touch/sencha-touch.js"></script> <script type="text/javascript" src="all-classes.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body> </body> </html>
Did I get it wrong, anyways?
Thanks.
-
1 Mar 2012 5:55 AM #7Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
For the most part that is correct. In your production index.html instead of having:
HTML Code:<script type="text/javascript" src="all-classes.js"></script> <script type="text/javascript" src="app.js"></script>
all-classes.js so be unminified where app-all.js is minified and should have app.js included also so app-all has all-classes.js and app.js and is minified.HTML Code:<script type="text/javascript" src="app-all.js"></script>
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.
-
1 Mar 2012 6:29 AM #8
Mmh, I adjusted my index.html and as expected, it did not influence the error.
Then I tried to remove the "requires" field of the claimed classes inside of "app-all.js".
This helped to do not get these errors, but my browser is then not able to instantiate some of my classes, anymore - either via "Ext.create" nor using items configuration. I'm just getting an TypeError "non_object_property_call".
By the way: when I move the class definition of the class which produces the "Ext.loader" error message, further down, the error message does not occur at all, even with the "requires" field.
What else can produce these problems?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote