0

I have an Ionic Cordova application at the following versions

"@ionic/angular-toolkit": "^6.1.0",
"@ionic/cordova-builders": "^6.1.0",
"cordova-android": "^11.0.0",
"cordova-plugin-splashscreen": "^6.0.1",

where I notice the splash screen is on longer using my own image (I am not sure how long it has been broken, only just noticed).

I re-installed npm i -g cordova-res and regenerated them all, updated to the above cordova-plugin-splashscreen but still all I get is

enter image description here

But that image is nowhere among my provided images.

Why am I getting this image that does not even exist?

halfer
  • 19,824
  • 17
  • 99
  • 186
peterc
  • 6,921
  • 9
  • 65
  • 131
  • Note that we prefer a technical style of writing here. We gently discourage greetings, hope-you-can-helps, thanks, advance thanks, notes of appreciation, regards, kind regards, signatures, please-can-you-helps, chatty material and abbreviated txtspk, pleading, how long you've been stuck, voting advice, meta commentary, etc. Just explain your problem, and show what you've tried, what you expected, and what actually happened. – halfer Mar 04 '23 at 13:08
  • On android the splashscreen has changed to "By default, SplashScreen uses the windowBackground of your theme if it's a single color and the launcher icon. The customization of the splash screen is done by adding attributes to the app theme." You can check here : https://developer.android.com/develop/ui/views/launch/splash-screen – uKioops Mar 04 '23 at 14:46

2 Answers2

2

Into config.xml

into

  <platform="android">

add:

<preference name="AndroidWindowSplashScreenBackground" value="#5988B5" />
        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/iconSplash.png" />

Remember delete cordova-plugin-splashscreen is deprecated in android-11 and remove the tags that refer to that plugin.

in my case they were these:

<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="none" />
<preference name="SplashScreenDelay" value="3000" />

That helped me to delete the icon that comes by default from cordova-android@11.

halfer
  • 19,824
  • 17
  • 99
  • 186
1

I found my answer in this post, the answer that starts with Step 1.

The problem was that the <splash> tag is no longer supported, we need to use...

<preference name="AndroidWindowSplashScreenAnimatedIcon" value="path to yourIcon.xml" />

The instructions in the above link was how I created my image - it appears we can't have as large images as before. I had to change min to be just an "icon" style image, and not include the application name etc as I use to. Also, once I had created my xml file, I did need to edit slightly in Android studio, but that was easy enough.

peterc
  • 6,921
  • 9
  • 65
  • 131