Yama
Yama

Reputation: 323

Ionic Cordova splash screen not hiding in Android

I have a simple application which works fine in browser and iOS, however for some reason in Android device and emulator they application stuck in the splash screen and do nothing. No error in the console log. however, in chrome inspector in chrome inspect I can see the application. already looked into google and couldn't find any helpful information.

Already removed and added splash screen plugin.

I am ready to release the but only this one bug is holding me and I am running out of time. Please help

enter image description here

enter image description here

Upvotes: 1

Views: 3383

Answers (1)

Prithivi Raj
Prithivi Raj

Reputation: 2736

On the first page you try to launch the App put splashScreen.hide() to hide the splashScreen manually.

ionViewDidEnter() {
    setTimeout(() => {
      if(this.platform.is('cordova')  || this.platform.is('android')){
      this.splashScreen.hide();
      }
    }, 300);

Also check the config.xml for Splash screen properties like the below

<preference name="SplashScreenDelay" value="10000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="FadeSplashScreenDuration" value="1000" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="ShowSplashScreenSpinner" value="true" />

Refer this link for property definitions.

  1. SplashScreenDelay (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen.
  2. "SplashShowOnlyFirstTime" preference is also optional and defaults to true. When set to true splash screen will only appear on application launch. However, if you plan to use navigator.app.exitApp() to close application and force splash screen appear on next launch, you should set this property to false (this also applies to closing the App with Back button).
  3. FadeSplashScreenDuration (float, defaults to 500): Specifies the number of milliseconds for the splash screen fade effect to execute.
  4. FadeSplashScreen (boolean, defaults to true): Set to false to prevent the splash screen from fading in and out when its display state changes.
  5. ShowSplashScreenSpinner (boolean, defaults to true): Set to false to hide the splash-screen spinner.

Upvotes: 1

Related Questions