"ionic build android" does not honor icons and splash images in config.xml


#1

Hi everybody,

I am using the default config.xml generated by “ionic start …” command. I had my graphics designer teammate design icons and splash images for the project. All images have the same names and paths with the ones in config.xml.

When I build for iOS there are no issues about splash or icon. But when building for Android, the app shows the default Cordova icon and splash.

My the section for icon and splash configuration in config.xml is as follows:

<platform name="android">
    <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
    <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
    <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
    <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
    <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
    <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
    <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
    <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
    <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
    <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
    <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
    <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
    <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
    <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
    <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
    <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
    <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
  </platform>
  <platform name="ios">
    <icon src="resources/ios/icon/icon.png" width="57" height="57"/>
    <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/>
    <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/>
    <icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80"/>
    <icon src="resources/ios/icon/icon-40@3x.png" width="120" height="120"/>
    <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/>
    <icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100"/>
    <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/>
    <icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120"/>
    <icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180"/>
    <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/>
    <icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144"/>
    <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/>
    <icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152"/>
    <icon src="resources/ios/icon/icon-83.5@2x.png" width="167" height="167"/>
    <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/>
    <icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58"/>
    <icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87"/>
    <splash src="resources/ios/splash/Default-568h@2x~iphone.png" height="1136" width="640"/>
    <splash src="resources/ios/splash/Default-667h.png" height="1334" width="750"/>
    <splash src="resources/ios/splash/Default-736h.png" height="2208" width="1242"/>
    <splash src="resources/ios/splash/Default-Landscape-736h.png" height="1242" width="2208"/>
    <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" height="1536" width="2048"/>
    <splash src="resources/ios/splash/Default-Landscape@~ipadpro.png" height="2048" width="2732"/>
    <splash src="resources/ios/splash/Default-Landscape~ipad.png" height="768" width="1024"/>
    <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" height="2048" width="1536"/>
    <splash src="resources/ios/splash/Default-Portrait@~ipadpro.png" height="2732" width="2048"/>
    <splash src="resources/ios/splash/Default-Portrait~ipad.png" height="1024" width="768"/>
    <splash src="resources/ios/splash/Default@2x~iphone.png" height="960" width="640"/>
    <splash src="resources/ios/splash/Default~iphone.png" height="480" width="320"/>
  </platform>

The output of “ionic info” command is:

Your system information:

Cordova CLI: 6.4.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.2
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.4
Xcode version: Xcode 8.1 Build version 8B62

My cordova-android version is 6.0.0

What’s wrong guys? What should I do to make ionic/cordova use the icons and splashes I provide instead of the default Cordova images? Any ideas?


#2

@EmreErdogan there is an issue with android it seems. See here:

Currently for me i replace density with qualifier and it works fine e.g.

<icon qualifier="xxhdpi" src="resources\android\icon\drawable-xxhdpi-icon.png" />

Do remember to run ionic resources first before making the changes.


#3

@ajohan Thanks for pointing out the issue on GitHub. I tried the workarounds but none of them worked for me. Finally I managed to make it work by downgrading cordova from 6.4.0 to 6.3.1 by running the following command:

npm install -g cordova@6.3.1

Then I did the following:

ionic platform remove android
ionic platform add android
ionic run android

Everyting’s fine for now :slight_smile:


#4

Not worked for me, but from the same link you provided, the solution worked is change the SplashScreen to splash:

And I'm using Cordova 6.4.0

I kept density.


#5

Ok Now I got new issue if I use
<preference name="SplashScreen" value="screen" />

The splash screen shows,
if I use <preference name="SplashScreen" value="splash" /> it show blank screen.