Ionic Android app gets black screen after launch

Since I have updated to the latest Ionic version 14, I see some strange behavior when the application starts up. The app loads fine the first time, but after a few hours or not using it, it stays idle when I try to open the app again.

After doing some research, I realized that this problem may have been that my main state only had an ion-nav-view element and nothing else:

<ion-nav-view name="homeContent"></ion-nav-view>

      

After adding an empty tag with ions to the page <ion-view></ion-view>

, as one user suggested, the screen won't darken as often, but he does it from time to time anyway.

Everything works fine when tested in a browser.

It is surprising if it tries to load the view when the application starts and it somehow fails to load it. I can see the screen "blinking" for a moment and then go to a black screen. And if I just close and reopen the app, it sometimes usually loads the UI.

I also noticed that the screen going blank usually happens a few hours after the last use of the app.

It took many hours to create a nice app, but can't release it to play store if it doesn't open consistently. Any help finding the problem would be appreciated.

All this only happens with the latest build. If I boot one of my old apk everything works fine.

+3


source to share


1 answer


Not sure exactly, but the resources required for the display may not yet exist. Perhaps by adding a screen splash, you could buy you a flickering load bill? One simple way to be like this:

app.run(function($cordovaSplashscreen, $timeout) {
    $timeout(function() {
        $cordovaSplashscreen.hide()
    }, 5000)
})

      



Cordova plugin screen plugin here

+2


source







All Articles