Splash Screen does not appear correctly in Android 12
See original GitHub issueIssue Description
After upgrading an android device to android 12 or using an android 12 emulator, the splash screen image no longer appears when the app loads. This has been brought up in discord at least twice, but there has been no response or guidance.
Google has posted documentation on migrating splash screens here: https://developer.android.com/guide/topics/ui/splash-screen/migrate
Reproduction
- Set up an emulator that uses android 12 (api 31)
- Create a new sample NS project using the ns cli (tested on 8.1.4). Note that I needed to follow the solution posted in https://github.com/NativeScript/NativeScript/issues/9659 and add
android:exported="true"
to the application node in the AndroidManifest.xml file - Run the project as usual (
ns debug android
, etc.) and observe the logo does not appear (the background does appear, though):
Relevant log output (if applicable)
n/a
Environment
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Shell: Not Found
node: 12.18.1
npm: 6.14.5
nativescript: Not Found
# android
java: 1.8.0_192
ndk: Not Found
apis: 28, 29, 30, 31
build_tools: 29.0.3, 30.0.3, 31.0.0, 32.0.0, 32.0.0
system_images:
- android-28 | Intel x86 Atom_64
- android-28 | Google APIs Intel x86 Atom
- android-28 | Google Play Intel x86 Atom
- android-29 | Google APIs Intel x86 Atom
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google APIs Intel x86 Atom_64
- android-30 | Google Play Intel x86 Atom
- android-31 | Google APIs Intel x86 Atom_64
# ios
xcode: Not Found
cocoapods: Not Found
python: 3.9.7
python3: Not Found
ruby: Not Found
platforms: Not Found
Dependencies
"dependencies": {
"@angular/animations": "^12.2.0",
"@angular/common": "^12.2.0",
"@angular/compiler": "^12.2.0",
"@angular/core": "^12.2.0",
"@angular/forms": "^12.2.0",
"@angular/platform-browser": "^12.2.0",
"@angular/platform-browser-dynamic": "^12.2.0",
"@angular/router": "^12.2.0",
"@nativescript/angular": "^12.2.0",
"@nativescript/core": "~8.1.1",
"@nativescript/theme": "~3.0.1",
"rxjs": "~7.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular/compiler-cli": "^12.2.0",
"@nativescript/android": "8.1.1",
"@nativescript/types": "~8.1.1",
"@nativescript/webpack": "~5.0.0",
"@ngtools/webpack": "^12.2.0",
"typescript": "~4.3.5"
}
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Android 12 Splash Screen Icon Not Displaying
When I run the app, I see the splash screen as expected on older OS versions like API 30, but when I run...
Read more >Migrate your existing splash screen implementation to ...
If your existing splash screen is implemented using a dedicated Activity , launching your app on devices running Android 12 or higher results...
Read more >Splash Screen Icon Not Displaying on API 31 when starting ...
In my testing, I found that when running the app on the emulator from Android Studio the splash screen icon is displayed for...
Read more >A Comprehensive Guide to Android 12's Splash Screen API
By default all apps on Android 12 will show a splash screen with the app icon at the centre. Sounds great until you...
Read more >Splash Screen in Android
On Android 12, every app will by default display a splash screen with the app symbol in the middle. Sounds wonderful until you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I played around with this a little, Here is a demo which utilizes the new Splash API while keeping the old splash screen for API < 31.
https://github.com/jcassidyav/api31Splash
We also noticed that issue on our Motorola device, however it seems to be related to the Nova Launcher somehow. When switching back to the default launcher, the Splashscreen is shown as expected.