App freezes on splash screen until app minimizes

I tried using the default template of framework7-cli , i ran the build-cordova-android command successfully, i installed it on my device, but anytime the app opens it gets stucks on the splash screen until i minimize it and open the app again then it responds. How can i solve this problem?

What happens if you use the Android simulator instead?

I just ran the code on my android emulator and it works the splash screen doesnt freeze. how can i fix this on my physical device not to freeze up

I’d say the best advice is connect your device to your computer, run the app on device, and use the Android Studio debugging tools to monitor what the app is doing. (I don’t actually know what is on offer for this, I only use XCode myself.) Hopefully in the debug/console you might get some clues as to what process is holding you up.
Also try to make sure you have all your plugins up-to-date.

I have done that, I ran the app directly on my phone and the splash screen doesn’t freeze but when i build the app for production the problem still occurs

In the Chrome inspector there is no error.?

With the phone conected to PC, open the device inspector AND check.
You need the app in debug mode.

How do I set the app in debug mode?

I use cordova cli.
cordova build android
Or
cordova run android

I have done this already in debug mode it run fine both on my phone and emulator but once I build to production the problem occurs.

I still need help on this…

Maybe this will help.
Need to replace handleSplashscreen function.
src/js/cordova-app.js:

handleSplashscreen: function () {
    setTimeout(() => {
        var f7 = cordovaApp.f7;
        if (window.navigator.splashscreen && !f7.device.electron) {
            window.navigator.splashscreen.hide();
        }
    }, 2000);
},
1 Like

Thank you …This solved it.

I still had issues and I am on the latest release.

I noticed that the f7ready is fired before cordova deviceready so I moved the cordovaApp.init(f7); call into the cordova deviceready event and its working each time now. I also dont need the setTimeout anymore.

App.svelte

onMount(() => {

document.addEventListener("deviceready", function(){
      console.log("Device is ready");
      // Init cordova APIs (see cordova-app.js)
      cordovaApp.init(f7);
}, false);
f7ready(() => {
  console.log("f7 is ready");
  

  // Call F7 APIs here
});

})

Still encountering the same problem on latest version with Vue. Android version is semi-ok since when you minimise the app it works. On the iOS though, i can’t get past the splash screen no matter what I do. Can you help me somehow? Thanks!