1. #1
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default Answered: Phonegap/Cordova get stuck on the loading page

    Answered: Phonegap/Cordova get stuck on the loading page


    Hi,

    I've made a blank new app with the sencha command tools, it works on my computer
    But when I put the app in Phonegap/Cordova, on the phone the app is stuck on the loading page.

    I've tried a ST2 App without microloader script found on the Internet and it works, so is there a bug in the microloader ?

    PS : I use cordova-2.1.0

  2. I've found the solution here :
    http://stackoverflow.com/questions/1...phonegap-issue

    You have to add at the top of app.js this code :
    Ext.Loader.setConfig({ enabled: true, disableCaching: false });

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,547
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to use a remote debugger to see if there are any errors being thrown. Most of the time it is due to a class not properly required before the build and therefor it's trying to load it but it does not exist, if this is the case then you need to require the class so the build will pick it up.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default


    Thank you for your answer, but you mean Java Classes or Sencha Classes ?

    I have used LogCat and get the following message :
    call to OpenGL ES API with no current context
    I solved it by adding
    android:hardwareAccelerated="true"
    in the Android Manifest,
    But I am still stuck on the loading page

  5. #4
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default


    Here is the logcat :
    10-11 15:30:30.395: V/webview(2189): singleCursorHandlerTouchEvent -getEditableSupport FASLE
    10-11 15:30:30.730: D/CordovaWebView(2189): >>> loadUrl(file:///android_asset/www/production/index.html)
    10-11 15:30:30.740: D/CordovaWebView(2189): >>> loadUrlNow()
    10-11 15:30:30.790: W/System.err(2189): java.net.SocketException: Socket closed
    10-11 15:30:30.790: W/System.err(2189): at libcore.io.Posix.accept(Native Method)
    10-11 15:30:30.790: W/System.err(2189): at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
    10-11 15:30:30.790: W/System.err(2189): at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
    10-11 15:30:30.790: W/System.err(2189): at java.net.ServerSocket.implAccept(ServerSocket.java:202)
    10-11 15:30:30.790: W/System.err(2189): at java.net.ServerSocket.accept(ServerSocket.java:127)
    10-11 15:30:30.790: W/System.err(2189): at org.apache.cordova.CallbackServer.run(CallbackServer.java:195)
    10-11 15:30:30.795: W/System.err(2189): at java.lang.Thread.run(Thread.java:856)
    10-11 15:30:30.805: D/DroidGap(2189): onMessage(onPageStarted,file:///android_asset/www/production/index.html)
    10-11 15:30:30.975: D/chromium(2189): Unknown chromium error: -6
    10-11 15:30:30.975: I/GATE(2189): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
    10-11 15:30:30.985: D/Cordova(2189): onPageFinished(file:///android_asset/www/production/index.html)
    10-11 15:30:30.985: D/CordovaWebView(2189): >>> loadUrlNow()
    10-11 15:30:30.990: D/DroidGap(2189): onMessage(onNativeReady,null)
    10-11 15:30:30.990: D/DroidGap(2189): onMessage(onPageFinished,file:///android_asset/www/production/index.html)
    10-11 15:30:31.050: D/DroidGap(2189): onMessage(spinner,stop)
    10-11 15:31:00.465: D/DroidGap(2189): Paused the application!
    10-11 15:31:00.465: D/CordovaWebView(2189): Handle the pause
    10-11 15:31:00.465: D/CordovaWebView(2189): >>> loadUrlNow()
    10-11 15:33:01.965: D/dalvikvm(2189): GC_CONCURRENT freed 352K, 5% free 9938K/10439K, paused 7ms+2ms

    I have got also the
    Code:
    java.net.SocketException: Socket closed
    ..
    Unknown chromium error: -6
    whith the ST2 App without microloader

  6. #5
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default


    I've linked the sencha-touch-all.js in the index.html and it works,
    <script type="text/javascript" charset="utf-8" src="sdk/sencha-touch-all.js"></script>
    It seems there is a problem with the code generated by the command line after
    <!-- The line below must be kept intact for Sencha Command to build your application -->
    I've linked the sencha-touch.js in the index.html and it doesn't work :
    10-11 19:13:04.710: D/CordovaLog(13082): Uncaught Error: [Ext.Loader] Failed loading 'file:///android_asset/www/production/sdk/src/log/Logger.js', please verify that the file exists
    And this file exists

    Is there something to set ?

  7. #6
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default


    I've found the solution here :
    http://stackoverflow.com/questions/1...phonegap-issue

    You have to add at the top of app.js this code :
    Ext.Loader.setConfig({ enabled: true, disableCaching: false });

  8. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,547
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should not be loading classes, you need to do a build and make sure all your classes were required properly.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  9. #8
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    Answers
    2
    ludm is on a distinguished road

      0  

    Default


    Ok but when I make a build, it doesn't load.
    After all the searches I've made, it seems to be a real problem, if you have a tutorial, I'm interested.

  10. #9
    Sencha User
    Join Date
    Jul 2012
    Posts
    177
    Vote Rating
    9
    huberte will become famous soon enough

      0  

    Default


    did you try with weinre ?