3 Replies Latest reply on Feb 17, 2017 5:38 AM by kerrishotts

    App reloads in release


      My released app randomly reloads, like it does in Phonegap App when sources are changed.

      One moment you are playing with the app - next moment you are on the welcome screen again.

      I don't see what is causing this. Because of other tips I changed to single page design and deregistered deviceready-event.

      Do you have any hint for me what this may be?

        • 1. Re: App reloads in release
          kerrishotts Adobe Employee

          Why wouldn't you register for deviceready? It's the only way to know when all Cordova plugins are available for use (including whitelist!).


          What device(s) and platform(s) are you experiencing this behavior on? How are you building the app (CLI, PGB?)


          I've seen occasions where the reload is a result of a JavaScript error -- double check your error handling (and any error reporting services you may have added).

          • 2. Re: App reloads in release
            Lilliput87 Level 1

            I use deviceready, but unregister when it is thrown first time. Just to see if that helps. But it didnt.

            I am testing on a Siswoo i7 with Android 5, but many of my testers have the same problem. All are Android at the moment.

            I am testing with phonegap Desktop. The error occurs there already. And it is still there when the app is released.


            What kind of JS error might cause reloading the whole app? There is no refresh or something like this in code.

            My error handling is:

            function Fehlerbehandlung (Nachricht, Datei, Zeile) {    var Fehler = "Fehlermeldung:\n" + Nachricht + "\n" + Datei + "\n" + Zeile;    alert(Fehler);    return true;   }   window.onerror = Fehlerbehandlung;

            So all errors are just shown as alert.

            • 3. Re: App reloads in release
              kerrishotts Adobe Employee

              I wanted to be certain that you didn't have an error reporting library that refreshed when an error occurred (I'm assuming the library assumed that the error meant the page was in an unrecoverable state, so a refresh is better than nothing). If you aren't using any reporting library, then ignore that particular train of thought.


              Without seeing some code, it's going to be difficult to help, though. Of course, code without error logs & an idea of where it goes wrong isn't ideal either, so I would suggest trying to narrow the problem down -- for example, does the issue occur after a specific (repeatable) set of actions? If you can narrow things down to a specific piece of your code and share any errors generated by that code when the refresh occurs, that would be far more useful.


              Also check your device console (adb logcat) for error messages around the time of the refresh. There might be some useful information there.