Search code examples
cordovaionic-frameworkcordova-pluginssplash-screen

Ionic splashscreen not working( Showing the same default icon )


I am trying to add a splashscreen to my ionic app. Here are the steps i followed:

$ionic start splashtest blank
$ionic platform add android
$cordova plugin add cordova-plugin-splashscreen

Now, Updated my icon.png and splash.png to  /splashtest/resources/ folder 
where the default icon.png and splash.png was there.

$ionic resources --splash
$ionic resources --icon

Generated Successfully.

The config.xml in my project folder( c:/splashtest/) is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.splashv2209052" version="0.0.1"   xmlns="http://www.w3.org/ns/widgets"  xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>splashv2</name>
<description>
    An Ionic Framework and Cordova project.
</description>
<author email="[email protected]" href="http://example.com/">
  Your Name Here
</author>
<content src="index.html"/>
<access origin="*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="FadeSplashScreenDuration" value="2000"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<platform name="android">
<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"/>
 <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"/>
</platform>
<icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
</widget>

I also saw that the icons in /splashtest/platforms/android/res/ are the default ones. But, my config.xml refers to the resources/android/splash folder. How can i fix this

Ionic -v
2.1.8


cordova -v
6.4.0

Thanks


Solution

  • You have the latest version of cordova, but probably not the latest version of the android platform. Update to the latest version.

    cordova platform update [email protected]
    

    EDITED: added @6.1.0 to the above command. Otherwise it will install version 6.0.0 and you will still have these problems.

    EDITED: Recently released Cordova version 6.5.0 has cordova-android version 6.1.1. So, now you can do:

    npm install -g cordova