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:
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)
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