cordovaionic-frameworkvisual-studio-2015tools-for-apache-cordova

Splash screens and icons stopped working after plugin upgrade


I created icons and splash screens for my mobile app some time ago following the Ionic blog Automating Icons and Splash Screens

Recently I upgraded cordova from 5.4.1 to 6.4.0. I also upgraded the plugins. The cordova-plugin-splashscreen went from 2.1.0 to 4.0.0.

Now my icons and splash screen don't work anymore.

There is a new folder in the project named "res" with subfolders that appear to contain screen.png's and icon.png's based on my original images, but the app isn't using them.

My config.xml contains entries that point to my original files like this:

<splash density="land-mdpi" src="resources\android\splash\drawable-land-mdpi-screen.png" />
<icon density="ldpi" src="resources\android\icon\drawable-ldpi-icon.png" />

I tried changing the paths in my config.xml to reference the new files in the "res" folder. e.g.:

<icon density="xxxhdpi" src="res\mipmap-xxxhdpi\icon.png" />      
<splash density="land-ldpi" src="res\drawable-land-hdpi\screen.png" />

But that didn't work. What should I do to get my splash screens and icons working again?


Solution

  • This appears to be related to "regression in cordova-android that has been fixed by the cordova team and released in 6.1.0"

    You may be able to fix it using these commands;

    Ionic platform remove android
    Ionic platform add android@6.1.0
    

    I am using Tools for Apache Cordova in Visual Studio 2015, and I'm unsure about combining that with the ionic command line tools, so I chose to roll my Cordova CLI version back to 6.3.1 - and now my splash screens and icons are working again

    Reference: https://github.com/driftyco/ionic/issues/9060#issuecomment-259445756