1. #1
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Answers
    2
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

    Default Answered: App hangs on appLoadingIndicator on Android native app - microloader issue

    Answered: App hangs on appLoadingIndicator on Android native app - microloader issue


    I have built my app using:
    Code:
    sencha app build
    And deployed it to my device (Android v4.0.4) using:
    Code:
    sencha app package run packager.json
    When the app starts on the device, it hangs on the appLoadingIndicator. I have been able to debug it to the point of understanding where the error happens, but I can't seem to get the why, or come up with a fix.

    The error occurs in this function in the microloader/production.js file:
    Code:
    function requestXhr(uri, onSuccess, onFailure) {
            var xhr = new XMLHttpRequest();
    
    
            onFailure = onFailure || emptyFn;
    
    
            uri = uri + ((uri.indexOf('?') == -1) ? '?' : '&') + Date.now();
    
    
            try {
               xhr.open('GET', uri, true);
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4) {
                        var status = xhr.status,
                            content = xhr.responseText;
    
    
                        if ((status >= 200 && status < 300) || status == 304 || (status == 0 && content.length > 0)) {
                            onSuccess(content);
                        }
                        else {
                            onFailure();
                        }
                    }
                };
                xhr.send(null);
            } catch (e) {
                onFailure();
            }
        }
    The problem is that xhr.open(...) is trying to open app.json (which is present in the same directory as the index.html file running this script), but the status returned is 0 and the responseText is an empty string. So, the onFailure() method gets called and the app just hangs.

    Can anybody please help with this issue? Thanks in advance...

  2. I have figured this one out. I was using the "production" build, which is the default when doing "sencha app build".

    I switched to using "sencha app build package" and it seems to be working. I have yet to figure out what the "production" build is actually for (thanks, [terrible] Sencha docs!), but hopefully this info helps others out.

  3. #2
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    danny36 is on a distinguished road

      0  

    Default


    I have the same problem.

  4. #3
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Answers
    2
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

    Default


    Quote Originally Posted by danny36 View Post
    I have the same problem.
    FYI Danny, I have posted a bug here: http://www.sencha.com/forum/showthread.php?254905

    I am hoping that Sencha addresses this soon. Seems like a huge issue if people can't create working native apps...

    If anyone else has insight in the meantime, feel free to pitch in.

  5. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    134
    Answers
    6
    Vote Rating
    5
    JRS is on a distinguished road

      0  

    Default How about Cordova/Phone gap

    How about Cordova/Phone gap


    I don't have answer for this problem. However, how about trying Cordova/Phonegap with your app. In the Examples forum Brice Mason has a Cordova Builder utility which automates the process.

    While you are waiting for fix from Sencha - you might want to give this a try.

  6. #5
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Answers
    2
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

    Default


    I have figured this one out. I was using the "production" build, which is the default when doing "sencha app build".

    I switched to using "sencha app build package" and it seems to be working. I have yet to figure out what the "production" build is actually for (thanks, [terrible] Sencha docs!), but hopefully this info helps others out.

Thread Participants: 2