capacitor: bug: Capacitor 4 - Android - No startup splash screen on real device

Bug Report

Capacitor Version

๐Ÿ’Š   Capacitor Doctor  ๐Ÿ’Š

Latest Dependencies:

  @capacitor/cli: 4.6.1
  @capacitor/core: 4.6.1
  @capacitor/android: 4.6.1
  @capacitor/ios: 4.6.1

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 4.6.1
  @capacitor/core: 4.6.1
  @capacitor/android: 4.6.1

[success] Android looking great! ๐Ÿ‘Œ

Platform(s)

Android

Current Behavior

On an Android device (xiaomi mi 11 lite, running Android 12) the startup splash screen doesnโ€™t show up. Calling SplashScreen.show when the app is loaded, works without any issue. This used to work on capacitor 3, but after the upgrade to capacitor 4 it doesnโ€™t anymore. On a simulator, it display a splash screen, but itโ€™s different from the one displayed by calling SplashScreen.show

Here is a video of the issue:

https://user-images.githubusercontent.com/216573/209322302-78436702-030c-4e6e-bda6-2dcc63659ce1.mp4

And here is the splash screen displayed on a simulator: Screenshot 2022-12-23 at 11 09 34

Expected Behavior

Display the splash screen

Code Reproduction

Iโ€™ve made a repository with the issue. Itโ€™s based on ionic starter app, with @capacitor/splash-screen installed https://github.com/JumBay/capacitor-splashscreen

Other Technical Details

npm --version output: 8.19.2

node --version output: v18.12.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (4 by maintainers)

Most upvoted comments

In Capacitor 3 it was not really working correctly neither, it shows a duplicated splash screen, first the OS splash screen and then old Capacitor splash screen. But since in your device the OS splash screen is not working you probably didnโ€™t notice as you only see a black screen for ~1/2 second or so and then the old Capacitor splash screen. In my Android 12 device I see the app icon for ~1/2 second and the the old Capacitor splash screen.

That duplicated splash screen is documented on the official Google docs for Android 12 Splash Screen migration docs

If your existing splash screen is implemented using a dedicated Activity, launching your app on devices running Android 12 or higher results in duplicate splash screens: the new system splash screen displays, followed by your existing splash screen activity.