Splashscreen on Android doesn't work (only showing white screen for 2 seconds)


#3

I’m also having the same problem, I’ve followed the instructions from http://ionicframework.com/docs/cli/icon-splashscreen.html, However I just see a white screen for a few seconds on Android. However it displays correctly on IOS.

I’m thinking it must not moving the assets to the correct place.

Does anyone have any ideas?


#4

Same problem here, maybe @mhartington has an idea :slight_smile: ?


#5

I’ve figured it out. I don’t know if everyone has the same issue but mine was because I installed corsswalk which has a different API which breaks the splashscreen. After some messing around with GIT I was able to remove crosswalk and it all works now.

Hope this helps.

Mike


#6

Thanks @mcknight, I also use crosswalk but don’t plan on removing it at all…

EDIT : found this https://crosswalk-project.org/documentation/manifest/launch_screen.html will look into it


#7

That looks very promising, Let me know if you mange to get it working. It would be really great to put crosswalk back in to my project at some point :smile:


Crosswalk Integration Beta in Ionic CLI (v1.3.2)
#8

Just to confirm, I guess we are all using crosswalk here :slight_smile:

PS: there is already a discussion about this problem in another post


#9

I don’t use Crosswalk, i have this in my config.xml file :

<platform name="android">
    <!-- you can use any density that exists in the Android project -->
    <splash src="splash/splash-port-hdpi.png" density="port-hdpi"/>
    <splash src="splash/splash-port-ldpi.png" density="port-ldpi"/>
    <splash src="splash/splash-port-mdpi.png" density="port-mdpi"/>
    <splash src="splash/splash-port-xhdpi.png" density="port-xhdpi"/>
</platform>
<preference name="SplashScreenDelay" value="10000" />

When i build my app, files ( splash/splash-port-hdpi.png etc … ) are well copied in the platform/android/res/drawable-port… folders, but when i run app i don’t see splash screen, just a black screen for 2 seconds…

My files like splash-port-xhdpi.png are original cordova splashscreen images so they have good format and size…

I don’t know what to do…


#10

I’m having the exact same problem too. I thought it may have been because of crosswalk, but I downloaded the basic tabs application, emulated onto an android device, and BOOM, no splashscreen. WHERE HAS IT GONE??? @mhartington WE NEED YOUR HELP :smile:


#11

In your config.xml, you need to add the following preferences:

<preference name="SplashScreen" value="foo" />
<preference name="SplashScreenDelay" value="10000" />

Where foo is the name of the splash screen file.
Make sure you’re including the first preference

http://plugins.cordova.io/#/package/org.apache.cordova.splashscreen


#12

@mhartington I already have that in my config.xml file.

...
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<platform name="android">
  <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
...


#13

So lets go over what going on

  1. Are you using crosswalk?
  2. Do you have the splash screen plugin install?

If you have crosswalk installed, that is a known bug, which the cordova team needs to fix.


#14
  1. Yes
  2. Yes

So it looks like we need to wait for the cordova team to fix it for my application.

However, I tested with the default tabs application, and the splashscreen doesn’t show either.

$ ionic start myapp tabs
$ ionic plugin add org.apache.cordova.splashscreen
$ ionic platform add android
$ ionic build android
$ ionic run android

No splashscreens. :fearful:

Thanks @mhartington for the help.


#15

Well you missed a step @seanhill

$ ionic start myapp tabs
$ ionic plugin add org.apache.cordova.splashscreen
$ ionic platform add android
$ vi config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.tmp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>tmp</name>
  <description>
        An Ionic Framework and Cordova project.
    </description>
  <author email="hi@ionicframework" href="http://ionicframework.com/">
      Ionic Framework Team
    </author>
  <content src="index.html"/>
  <access origin="*"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="BackupWebStorage" value="none"/>

  <!-- You still need to add this to the config.xml -->
  <preference name="SplashScreen" value="screen" />
  <preference name="SplashScreenDelay" value="10000" />
  
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true"/>
  </feature>
</widget>
$ ionic build android
$ ionic run android

This will give you a splash screen on android w/o crosswalk


Navbar linear gradient and button backgrounds
#16

@mhartington you’re right. Once again. Thanks!

In the meantime, I’ll just :`( while cordova updates…


#17

We all will, le sigh


#18

I also had the same issue but checking through commits for the splash screen plugin it looks like they added support for Cordova 4.0 in this commit:

Updating to latest has removed the white screen during launch from within my app.

Now I only have a white screen when animating to the multitasking app list on Lollipop.


[SOLVED] Splash screen not showing, already tried answers on other posts and nothing!
#19

@dkeane it looks like the code on the github repo for Splashscreen.java is different then when I install it via the command line. Is their code out of date with the cordova registry?


#20

@dkeane can you explain the process you used to display a splashscreen? Thanks a lot


#21

Yes it looks like the plugin registry is pointing to their latest release: 0.3.5 from December. I added the plugin by using the github url which pulled in latest from master:

cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git

To setup the splash screen I followed the steps listed above as everything seems to work like normal.


Crosswalk Integration Beta in Ionic CLI (v1.3.2)
#22

you mean with crosswalk ?