Can't specify Android splash image

What platform are you building for?

Android

What framework are you building with?

Cordova

What is your build ID?

9cc06e45-c03f-4039-9511-0996046d7bf0

What is your error message?

UserError: Failed to restore plugin “cordova-plugin-splashscreen”.
You might need to try adding it again.
Error: TypeError: Cannot read properties of null (reading ‘find’)

Please describe the issue:

I get the app icon at splash alright. However, I want it to show a brand image PNG again like it used to.

Turns out it pretty darn impossible with current required Android versions.

I used edit-config variations and also created a themes.xml file but always get a compilation error. Tried different names for the themes.

<platform name="android">
    <resource-file src="resources/android/res/drawable/splash_icon.png" target="app/src/main/res/drawable/splash_icon.png" />
<!--<edit-config file="app/src/main/res/values/themes.xml" mode="merge" target="/resources/style[@name='Theme.App.SplashScreen']">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
</edit-config>

<edit-config file="app/src/main/res/values/themes.xml" target="/resources/style[@name='MainActivityTheme.Launcher']" mode="merge">
<style name="MainActivityTheme.Launcher">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
</edit-config>
<resource-file src="app/src/main/res/values/themes.xml" target="www/themes.xml" />
</platform>

<platform name="android">
<edit-config file="app/src/main/res/values/themes.xml" mode="merge" target="/resources/style[@name='AppTheme.Launcher']">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
</edit-config>
</platform>

Some settings:

<engine name="android" spec="14.0.1" />
<preference name="android-minSdkVersion" value="24"/>
<preference name="android-targetSdkVersion" value="35"/>
<preference name="android-compileSdkVersion" value="35" />
<plugin name="cordova-plugin-splashscreen" spec="6.0.2" />

Any idea how to get this done?

I suspect you’re having trouble with the splashscreen plugin because that functionality has been moved to core:

Android Note: Android implementation has been moved to the core framework. If using cordova-android@10.x or earlier, use cordova-plugin-splashscreen@6.x If using cordova-android@11.x or later and exclusively developing for Android, this plugin can be uninstalled.

Android has done away with splash screens in general. If you want a splash screen it must be implemented in your app. Essentially you would display the splash screen as your very first action, then perform any other up front processing (or pause) and then finally display your initial screen. If you look at other apps on Android that still have splash screens, you’ll notice that this is actually what they’re doing.