flutter_native_splash icon indicating copy to clipboard operation
flutter_native_splash copied to clipboard

Android 12+ issues (fullscreen and icon_background_color)

Open jibbers42 opened this issue 8 months ago • 7 comments

Attention: If you open a bug report without sufficient details, it will be closed. Is your question related to Android 12? Please check the notes on Android 12 first (https://pub.dev/packages/flutter_native_splash#android-12-support).

Describe the bug

  • icon_background_color does not seem to have any effect. My assumption is that this setting should change the color of the circle behind the icon.
  • fullscreen does not seem to have any effect on Android 12+. On Android 11 the system bars do not show.

Configuration

flutter_native_splash:
  color: "#42a5f5"
  image: "assets/splash.png"

  android_12:
    color: "#42a5f5"
    icon_background_color: "#111111"

  ios: false
  web: false
  android_gravity: fill
  fullscreen: true

Device (please complete the following information):

  • Device: emulator v32.1.15-10696886 OS: Android 13

  • Device: emulator v32.1.15-10696886 OS: Android 11

  • Device: Pixel 3 XL OS: Android 12

To Reproduce Steps to reproduce the behavior, using the example app:

  1. Set the config on the example app to config given above.
  2. Run using devices listed above.
  3. See fullscreen have no effect on Android 12+
  4. See icon background color remain white on Android 12+.

Additional context The readme links to https://developer.android.com/about/versions/12/features/splash-screen, I'm not sure if I'm supposed to make a changes listed there, but I did add implementation "androidx.core:core-splashscreen:1.0.0" to my build.gradle as a test, but it had no effect.

jibbers42 avatar Nov 27 '23 08:11 jibbers42

I wanted to reach out regarding an issue I'm experiencing with the native_splashscreen on Android 12. I've tested it on versions 11, 12, and 13, and here's what I found:

  • Android 11: The image displays correctly.
  • Android 12: The image is not showing at all, regardless of API version (31 or 32).
  • Android 13: The new changes result in a clipped circle as expected.

I've tried various approaches, but on Android 12, there seems to be no way to make the image display. Have you encountered a similar problem, or do you have any insights on resolving this?

this is my configuration:

flutter_native_splash:
  color: "#8F497B"
  image: assets/images/winesip_splashscreen.png
  fullscreen: true
  ios_content_mode: scaleToFill
  android_gravity: fill
  web: false

  android_12:
    color: "#8F497B"
    image: assets/icons/launcher/android/splashScreen_android12.png

labrujasiete avatar Dec 02 '23 05:12 labrujasiete

@labrujasiete Android 12 has an issue where it doesn't show the app icon on the splash screen when launched from another process (https://issuetracker.google.com/issues/205021357). That may also apply to using image, I'm not sure.

Try force killing the app then running if from the device launcher and see if the image shows up.

anthonyStratis avatar Dec 02 '23 05:12 anthonyStratis

@labrujasiete Android 12 has an issue where it doesn't show the app icon on the splash screen when launched from another process (https://issuetracker.google.com/issues/205021357). That may also apply to using image, I'm not sure.

Try force killing the app then running if from the device launcher and see if the image shows up.

Yes, i've already come across this tip and i've already tried force killing the app and launching it from the device launcher, as suggested, but the issue persists.

labrujasiete avatar Dec 02 '23 05:12 labrujasiete

on Android 12, flutter 3.16.3 white screen:

flutter_native_splash:
background_image: assets/splash.png
image: assets/appicon.png
web: false
android_gravity: clip_horizontal
ios_content_mode: scaleAspectFill

I experienced the issue after upgrading flutter from 3.10.5.

vko85 avatar Dec 12 '23 10:12 vko85

@jibbers42 yes, icon_background_color should set the color of your icon's background. Do you have areas of transparency in your icon where the background color can show through? Also, have you tried changing the color to something like "#FF0000" to see if it shows through? I don't believe Android 12+ supports full screen splash screens.

jonbhanson avatar Dec 31 '23 15:12 jonbhanson

@jibbers42 yes, icon_background_color should set the color of your icon's background. Do you have areas of transparency in your icon where the background color can show through? Also, have you tried changing the color to something like "#FF0000" to see if it shows through? I don't believe Android 12+ supports full screen splash screens.

The provided config does not specify an image for android_12, so it should use the launcher icon. I used this project's example app with the default flutter icons which does seem to use a transparent background.

Given this config on API 33:

flutter_native_splash:
  color: "#00ff00"
  image: "assets/splash.png"

  android_12:
    color: "#00ff00"
    icon_background_color: "#ff0000"

  ios: false
  web: false
  android_gravity: fill
  fullscreen: true

I get: image

It seems like the white in the icon should be red, unless I'm misunderstanding something.

jibbers42 avatar Jan 01 '24 20:01 jibbers42

@jibbers42 I'm not sure if it supports transparency in the end, so i think we should make the icon image to the desire color, Everything else seems to be working fine, as to API 33

labrujasiete avatar Jan 04 '24 08:01 labrujasiete

I've been experiencing similar struggles as well. Adding a comment to bump the issue.

lauriewu1 avatar Feb 07 '24 19:02 lauriewu1

The background image is not shown even though I gave background_image(issue only in android 12+).

My configuration: flutter_native_splash: image: assets/rdr.png background_image: assets/sc.png fullscreen: true android_gravity: fill ios_content_mode: center

android_12: image: assets/rdr.png background_image: assets/sc.png fullscreen: true android_gravity: fill ios_content_mode: center

web: false

[✓] Flutter (Channel stable, 3.16.9, on Ubuntu 22.04.3 LTS 6.5.0-17-generic, locale en_IN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2023.1) [✓] Android Studio (version 2021.2) [✓] IntelliJ IDEA Community Edition (version 2023.1) [✓] VS Code (version unknown) ✗ Unable to determine VS Code version. [✓] Connected device (3 available) [✓] Network resources

• No issues found!

AK47-23 avatar Feb 09 '24 05:02 AK47-23

I observe similar issues as mentioned above.

stwarwas avatar Feb 22 '24 02:02 stwarwas

Thank you for the wonderful package.

I have experienced a similar issue. After upgrading Flutter SDK from version 3.7.8 to 3.19.1, the image specified for the splash screen is not displayed only on the first launch of the app.

  • It was functioning without any issues on Flutter 3.7.8.
  • The issue occurs only on Android; iOS displays the splash screen correctly.
  • The issue occurs only on Android physical devices; it is displayed correctly on the Android Studio emulator.
  • The image specified for the splash screen is not displayed (other configurations such as background color are applied correctly).
  • The issue occurs on the first launch after installing the app, but it does NOT when the app is closed and reopened.
environment:
  sdk: ">=3.0.0 <4.0.0"
# ...
dependencies:
  flutter_native_splash: ^2.3.10
# ...
flutter_native_splash:
  color: "#ffffff"
  image: "assets/img/logo_splash.png"
  color_dark: "#ffffff"
  image_dark: "assets/img/logo_splash.png"
  android_12:
    icon_background_color: "#ffffff"
    image: "assets/img/logo_splash_android.png"
    icon_background_color_dark: "#ffffff"
    image_dark: "assets/img/logo_splash_android.png"

morhi-2214 avatar Feb 28 '24 09:02 morhi-2214

I am using on Android 14. I am facing similar issues Also I can not set color to white if device is in dark mode as stated in issue #485. Icon background color has no effect and I can not set custom image as my splash screen

afzl-wtu avatar Apr 02 '24 05:04 afzl-wtu

@afzl-wtu Did you find any solution?

nuriulgen avatar May 31 '24 08:05 nuriulgen

any solution for this issue :(?

RoyalCoder88 avatar Jul 05 '24 19:07 RoyalCoder88

?

hsynucak avatar Jul 07 '24 09:07 hsynucak