1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    42
    Vote Rating
    0
    Answers
    2
    anthoang is on a distinguished road

      0  

    Default Answered: A white/blank screen when packaging Sencha Touch app in PhoneGap Build

    Answered: A white/blank screen when packaging Sencha Touch app in PhoneGap Build


    Just thought I share this to anyone who will have this same problem. since it took me two days to debug and figure this one out. If you happen to get a blank/white screen when you package your Sencha Touch app in PhoneGap build, it's because you're still using the secha-touch-all-debug.js library. Here's what I did to fix it,

    was using secha-touch-all-debug.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all-debug.js">
    changed to sencha-touch-all.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all.js">

    ======================================
    Steps to using PhoneGap Build

    1.) sign up at http://build.phonegap.com (its beta and currently free)
    2.) compress/zip your secha touch app (make sure there's an index.html file in the root of the zip file)
    3.) in the "apps" section of your build.phonegap.com account, upload this zip/archive file to phonegap.
    4.) wait a couple of minutes for phonegap to compile your zip file. it will generate the ipa (iphone), apk (android) and other mobile app files for you.
    5.) download the apk file that phonegap just build and copy it to your Android sim card.
    6.) using a file manager system (i used Linda File Manager from the android market) to install my apk file.
    7.) you should now be able to click on the new app and run your Sencha Touch app as if it's like a native app.
    (again, if you get a white screen, see my fix above)

  2. was using secha-touch-all-debug.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all-debug.js">
    changed to sencha-touch-all.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all.js">

  3. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    42
    Vote Rating
    0
    Answers
    2
    anthoang is on a distinguished road

      0  

    Default


    was using secha-touch-all-debug.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all-debug.js">
    changed to sencha-touch-all.js
    Code:
    <script type="text/javascript" src="lib/touch2/sencha-touch-all.js">

  4. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,156
    Vote Rating
    4
    Answers
    93
    rdougan is on a distinguished road

      0  

    Default


    I'm going to sticky this for a while. Same thing keeps coming up again and again. Thanks!
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
    kunickiaj is on a distinguished road

      0  

    Default Doesn't seem to fix the white screen issue for me

    Doesn't seem to fix the white screen issue for me


    Do you have an example of your index.html and app.js for properly launching a Sencha Touch 2.0 app using PhoneGap?

    I'm using PR4 and PG 1.3.0 and trying to use the mvc app from http://www.sencha.com/forum/showthre...le-MVC-example as a starting point.

    Regards,
    Adam

  6. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    187
    Vote Rating
    0
    Answers
    8
    umr.ashrf is an unknown quantity at this point

      0  

    Default


    Did you try placing phonegap.js before sencha-touch-all-debug.js? It does matter and solved my issue.

  7. #6
    Sencha User
    Join Date
    Jan 2012
    Posts
    7
    Vote Rating
    0
    marker7799 is on a distinguished road

      0  

    Default same problem

    same problem


    Also seeing same problem with suggestions above...PhoneGap 1.3 and latest Touch2. I'm building in latest xcode and running app within iOS simulator.

  8. #7
    Sencha User
    Join Date
    Feb 2011
    Posts
    7
    Vote Rating
    0
    kingkong22 is on a distinguished road

      0  

    Default


    that mvc example not longer usable in PR4. you need to change some code in order to make it works. In order to make it work you need to include phonegap-1.3.0.js that come with the framework.

  9. #8
    Sencha User
    Join Date
    Jan 2012
    Posts
    7
    Vote Rating
    0
    marker7799 is on a distinguished road

      0  

    Default


    I've already included the phonegap javascript file. And phonegap loads just fine. The problem is that PR4 does not load...even with a basic helloworld example I get a blank white screen.

  10. #9
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,156
    Vote Rating
    4
    Answers
    93
    rdougan is on a distinguished road

      0  

    Default


    Quote Originally Posted by marker7799 View Post
    I've already included the phonegap javascript file. And phonegap loads just fine. The problem is that PR4 does not load...even with a basic helloworld example I get a blank white screen.
    I presume it works in a browser?
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  11. #10
    Sencha User
    Join Date
    Jan 2012
    Posts
    7
    Vote Rating
    0
    marker7799 is on a distinguished road

      0  

    Default


    No, it doesn't load in the browser either.

    I'm simplified the app to a simple index.html that includes the phonegap-1.3.js file and the basic sencha 2 files:

    index.html

    Code:
    <script type="text/javascript" src="phonegap-1.3.0.js"></script>
    <link href="lib/touch/sencha-touch.css" rel="stylesheet" type="text/css" />           
    <!-- I've switched this file around as suggested above-->
     <script type="text/javascript" src="lib/touch/sencha-touch-all-debug.js"></script>
    <script type="text/javascript" src="app/app.js"></script>
    app.js is a simple alert() box from the launch() function as seen in the hello world examples. I've tried to reduce the app as much as possible to isolate the issue.

    Also, I've placed test code in the index.html file for the phonegap module and it loads just fine. So, if phonegap loads and sencha does not...seems to me the problem is sencha 2.