Splash screen android 12

hello,
i want to add a splash screen image to my app.

i generate the icon and splash with this:

npx capacitor-assets generate

icons worked for ios and android
but splash screen only works with android < v12

i see that from v12 its a common behavior from android OS. lowest version worked well

expected result-android 10
image

actual-android 12
image

i couldnt find a way to show correctly splash

styles.xml

<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
        <item name="android:background">@drawable/splash</item>
        <item name="android:windowSplashScreenAnimatedIcon">@drawable/splash</item>
        <item name="android:windowSplashScreenIconBackgroundColor">#004d28</item>
        <item name="windowSplashScreenBackground">#00646A</item>
    </style>

capacitor.config.ts

  plugins: {
    SplashScreen: {
      launchShowDuration: 3000,
      launchAutoHide: true,
      launchFadeOutDuration: 3000,
      backgroundColor: '#ffffffff',
      androidSplashResourceName: 'splash',
      androidScaleType: 'CENTER_CROP',
      showSpinner: true,
      androidSpinnerStyle: 'large',
      iosSpinnerStyle: 'small',
      spinnerColor: '#3d4213',
      splashFullScreen: true,
      splashImmersive: true,
      layoutName: 'launch_screen',
      useDialog: true,
    },

do i have to touch someting in android studio? in thtat case I should configure it every time a build a apk?
is it possible to add a splash screen in android12 and majors?

Hello, I had the same problem and I added the following to my project:

  1. AndroidManifest.xml
    in this file you have to replace the line of the theme on aplication->activity->android theme
    with this one: android:theme=“@style/Theme.RemoveSplashScreenTheme”
  2. Styles.xml - you can find this on: Android-> app-> src->res->values
    You have to add this tow style tags: true @drawable/splash

The second one style tag, you may have it so remove the one you have and add those two.

I hope this will help you. It worked for me.

didn’t work

adroid manifest theme has to be same as style.xml->AppTheme

if i only put @drawable/splash, it likes the beginning.works on android <12 but no 12+

Android 12 changed how the splash screens work, it’s built into the OS, you can’t use full screen splash images anymore starting on Android 12, you have to use an icon, and if not configured it uses the app icon