xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

[Bug] Problem with SplashScreen #15635

Closed freezersharp closed 1 year ago

freezersharp commented 1 year ago

Description

All my mobile apps using splash screens but I'm facing an issue when I use Android 13 devices, because these splash screens are not showing. Android 12 (and below) devices are working fine.

Steps to Reproduce

  1. All steps for the android splash process (splash.xml, splashActivity, styles.xml, image in drawable folder, etc.)
  2. Set both Android Target version and Compile using Android version options in the Android project, to Android 13.0 (API level 33).
  3. Run the app or generate the APK file to testing.

Expected Behavior

Splash screen is showed in all Android devices.

Actual Behavior

Android 12 and below, the splash screen is showed correctly. Android 13: a white screen is showed and the app icon in the middle.

Basic Information

Environment

Tested using Visual Studio 2022 and 2022 Preview, with the lastest updates. Xamarin Forms 5, even I installed additional nuget packages like:

Xamarin.Android.Support.v4 Xamarin.Android.Support.v7.AppCompat Xamarin.AndroidX.Core.SplashScreen

Nothing works.

AlleSchonWeg commented 1 year ago

Android 12 implemented a new Splash Screen API: https://developer.android.com/about/versions/12/behavior-changes-all#splash-screen-migration Perhaps this could be your problem.

jfversluis commented 1 year ago

This should help: https://codetraveler.io/2022/08/16/supporting-android-splash-screens-in-xamarin-forms/