Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 12+ issues (fullscreen and icon_background_color) #626

Open
jibbers42 opened this issue Nov 27, 2023 · 16 comments
Open

Android 12+ issues (fullscreen and icon_background_color) #626

jibbers42 opened this issue Nov 27, 2023 · 16 comments

Comments

@jibbers42
Copy link

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.

@labrujasiete
Copy link

labrujasiete commented Dec 2, 2023

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

@anthonyStratis
Copy link

@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.

@labrujasiete
Copy link

labrujasiete commented Dec 2, 2023

@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.

@vko85
Copy link

vko85 commented Dec 12, 2023

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.

@jonbhanson
Copy link
Owner

@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.

@jibbers42
Copy link
Author

@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.

@labrujasiete
Copy link

@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

@lauriewu1
Copy link

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

@AK47-23
Copy link

AK47-23 commented Feb 9, 2024

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!

@stwarwas
Copy link

I observe similar issues as mentioned above.

@morhi-2214
Copy link

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"

@afzl-wtu
Copy link

afzl-wtu commented Apr 2, 2024

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

@nuriulgen
Copy link

@afzl-wtu Did you find any solution?

@RoyalCoder88
Copy link

any solution for this issue :(?

@hsynucak
Copy link

hsynucak commented Jul 7, 2024

?

@shihabmi7
Copy link

any solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests