jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.27k stars 200 forks source link

[Android] app icon not showing on Android 12 #681

Open toando0612 opened 1 month ago

toando0612 commented 1 month ago

Describe the bug:

My Issue:

image

The result that I want:

image

When I run Physical Device and Emulator with Android 12. Splash Screen show, but only have background color. App icon not display.In addition, there were two results if I kill the Application and open it again: Emulator: app icon shown when open again Physical Xiaomi Device: app icon still not display, only see background color as before

-My issue currently happening on (Android 12). -Android 13 and above working OK. -Android below 12 working OK. -Only happen with Android 12

This is my flutter_native_splash.yaml:

flutter_native_splash:
  image: assets/images/launch_image.png
  image_dark: assets/images/launch_image.png

  android_12:
    color: "#F14D89"
    color_dark: "#F14D89"
    image: assets/images/app_logo.png
    image_dark: assets/images/app_logo.png

  web: false
  android: true
  ios: false

Devices: Physical: Xiaomi 11T 12 SP1A, MIUI Global 13.0.5 Emulator: Pixel_6a_API_31 Emulator: Pixel_6a_API_34

To Reproduce

  1. Run Application on Emulator/Physical Android 12 devices
  2. Kill the app
  3. Open app again
jonbhanson commented 1 month ago

Did you check out the notes at the bottom of the Android 12 section?

toando0612 commented 1 month ago

Did you check out the notes at the bottom of the Android 12 section?

Thank you for your response! Yes, I checked that, but it still an issue with my app. I used PNG image 1152x1152 to generate app icon as description. In addition, I built apk and release apk to physical device. I opened app many times (cold start). The problem still happen, I cannot see app icon. I am trying to check everything again and still not find solution yet, anyway, highly appreciated you supports

nicoolle commented 1 month ago

I have the same issue

2x2xplz commented 3 weeks ago

Hi, I am also experiencing this. Was developing on a physical device running Android 12 and I could set the splash screen's background color but no matter what, the image did not appear on the splash screen. Tried an emulator running Android 13 and it works fine, image shows up. After seeing this issue, I built an Android 12 emulator and once again, no image.

My image is exactly 1152x1152 as specified, PNG with transparent background. However I tested with other image sizes and none of them showed up either on my physical Android 12 device.

Thank you.

2x2xplz commented 3 weeks ago

OK unfortunately this appears to be a longstanding known issue with Android. See https://stackoverflow.com/questions/69812590/android-12-splash-screen-icon-not-displaying and https://issuetracker.google.com/issues/205021357?pli=1

The StackOverflow checked response indicates that the icon won't show when the app is launched from Android Studio but it does show if the app is launched from the default launcher. Personally this is still not working on my physical device, however I do see it working on the emulated Android 12. The emulated device is a Pixel with default Pixel launcher while my physical device is not a Pixel and runs a third-party launcher. The issue tracker also seems to indicate that some launching scenarios won't show the icon, such as launching from a notification.

Definitely annoying but it doesn't appear that this package has any ability to "fix" this issue.

Hi, I am also experiencing this. Was developing on a physical device running Android 12 and I could set the splash screen's background color but no matter what, the image did not appear on the splash screen. Tried an emulator running Android 13 and it works fine, image shows up. After seeing this issue, I built an Android 12 emulator and once again, no image.

My image is exactly 1152x1152 as specified, PNG with transparent background. However I tested with other image sizes and none of them showed up either on my physical Android 12 device.

Thank you.

jonbhanson commented 2 weeks ago

@toando0612 is your issue different from the issue referenced (https://stackoverflow.com/questions/69812590/android-12-splash-screen-icon-not-displaying and https://issuetracker.google.com/issues/205021357?pli=1)? If it is the same, it is related to Android API 31, and not Flutter or this package.

toando0612 commented 1 week ago

@toando0612 is your issue different from the issue referenced (https://stackoverflow.com/questions/69812590/android-12-splash-screen-icon-not-displaying and https://issuetracker.google.com/issues/205021357?pli=1)? If it is the same, it is related to Android API 31, and not Flutter or this package.

Still not found solution yet, do you have any idea to fix this? I tried other images as middle app icon. It displays background color only, no app icon at all