Android splash screens stopped showing without any reason

  • 1
  • Problem
  • Updated 4 years ago
Hi there.

I am using Cordova 5.2.0 and cordova-plugin-splashscreen 3.2.2.

There is no way of upgrading Cordova to newest version due to other project dependencies.

Until yesterday the app built on PGB was successfully showing splash screens, but today there is only blank screen appearing on the same Android devices.

The app icons still work just like before.
Surprisingly splash screens appear normally when the project is built locally...
Do you know what can be causing this?
Thanks in advance for help!

Here goes the relevant part of config.xml:
Photo of Matt

Matt

  • 4 Posts
  • 0 Reply Likes
  • frustrated

Posted 4 years ago

  • 1
Photo of Matt

Matt

  • 4 Posts
  • 0 Reply Likes
Sorry, the XML was missing. Here it is:




<plugin name="cordova-plugin-hockeyapp" spec="2.1.0" />
<plugin name="cordova-plugin-whitelist" spec="1.2.1" />
<plugin name="cordova-plugin-camera" spec="1.2.0" />
<plugin name="cordova-plugin-crosswalk-webview" spec="1.5.0" />
<plugin name="cordova-plugin-wkwebview" spec="0.6.9" />
<plugin name="cordova-plugin-splashscreen" spec="3.2.2" />
<plugin name="cordova-plugin-statusbar" spec="2.1.0" />
<plugin name="cordova-sqlite-storage" spec="https://github.com/litehelpers/Cordova-sqlite-storage#32ef213" />
<plugin name="cordova-plugin-network-information" spec="1.2.1" />
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="android-build-tool" value="gradle" />
<preference name="DisallowOverscroll" value="true" />
<preference name="fullscreen" value="false" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="FadeSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="AutoHideSplashScreen" value="false" />
<platform name="android">
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="orientation" value="portrait" />
<allow-intent href="market:*" />
<preference name="SplashMaintainAspectRatio" value="true" />
<icon src="img/android/icon-ldpi.png" density="ldpi" />
<icon src="img/android/icon-mdpi.png" density="mdpi" />
<icon src="img/android/icon-hdpi.png" density="hdpi" />
<icon src="img/android/icon-xhdpi.png" density="xhdpi" />
<icon src="img/android/icon-xxhdpi.png" density="xxhdpi" />
<icon src="img/android/icon-xxxhdpi.png" density="xxxhdpi" />
<splash src="img/android/splash-ldpi.png" density="port-ldpi" />
<splash src="img/android/splash-mdpi.png" density="port-mdpi" />
<splash src="img/android/splash-hdpi.png" density="port-hdpi" />
<splash src="img/android/splash-xhdpi.png" density="port-xhdpi" />
<splash src="img/android/splash-xxhdpi.png" density="port-xhdpi" />
<splash src="img/android/splash-xxxhdpi.png" density="port-xhdpi" />
</platform>
<preference name="xwalkVersion" value="16+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
</pre>
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You are using compound qualifiers as a value for the density. Can't do that. Use the qualifier attribute instead.

Also, you have specified three different images for 'port-hdpi', which makes no sense.

Since you only posted part of the config, I can't check the file paths, file dimensions and mime types. Also, I can't see whther or not the other config parts cause any errors.

You have a loose </pre> tag in your config.xml, which makes the xml invalid.
Photo of Matt

Matt

  • 4 Posts
  • 0 Reply Likes
Hi. Thanks for answering.

Not sure what you mean by:

"You are using compound qualifiers as a value for the density. Can't do that. Use the qualifier attribute instead. "

According to plugin's documentation at:

https://github.com/apache/cordova-plu...

the proper way of defining splash screens is:




<!-- you can use any density that exists in the Android project -->
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi"/>
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi"/>
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi"/>
<splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi"/>

<splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/>
<splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/>
<splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/>
<splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/>



Can you give some more description about your comment?

As of the PRE tag - yes, it's only a fault visible here in forum comment. Obviously it does not exist in config.xml

There's nothing more in config related to sizes or paths.
Photo of Matt

Matt

  • 4 Posts
  • 0 Reply Likes
... and the multiple density="hdpi" was fixed, thanks, but did not help with the issue
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You have density="port-ldpi"

Correct is:
qualifier="port-ldpi" density="ldpi"

The splashscreen plugin's docs are wrong at that point.
See the PGB Docs, instead
Photo of Tomasz Jankowski

Tomasz Jankowski

  • 3 Posts
  • 0 Reply Likes
Hi Petra, thanks for your help. Your solution resolved our problem.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Matt,
Since this is your first post, please answer the following question:
- is this your first hybrid app?
- are you using Desktop App?
- are you using CLI, Build, or SDK? Please do not assume the answer, please read the link.

Thanks
Jesse
Photo of Tomasz Jankowski

Tomasz Jankowski

  • 3 Posts
  • 0 Reply Likes
Hi Jesse,
I can answer your questions about our project:
- it's not our first hybrid app, but first after some time (about 6-8 months if I remember correctly)
- no, we are not using Desktop App
- in development environments we are using cordova CLI but we are using Build Phonegap as part of ours CI
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Tomasz,
1) is everyone aware that Build and CLi not the same and it requires changes so that the files of one can work with the other?
2) You say say you are using Phonegap Build as part of your CI. What is CI?

Jesse
Photo of Tomasz Jankowski

Tomasz Jankowski

  • 3 Posts
  • 0 Reply Likes
1) Yes, we are aware that Build and CLI requires different config.xml configuration. We just didn't notice the splashscreen part and we were using it according to the plugin documentation. For some reason invalid configuration was working some time ago but it's our mistake that we didn't read Phonegap documentation.
2) Continuous integration (CI). Every change in the code is verified by build server (code linting, formatting, tests) and when everything is checked we are using Phonegap Build API to build application packages for our client.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Tomasz,
hmmm.....
Okay, please correct any errors I am making.
1) I assume your issues are solved, if not please let me know.
2) You are building for a limited number of platforms - Android, iOS, Windows at most.
If those are incorrect, let me know.

I am going to recommend that you and your team move to CLI exclusively. You should know that Cordova and Phonegap make changes almost weekly that affect our (PGB) workflow. Sometimes, it is minor; sometimes, it makes the day very difficult.

I suggest you move to CLi for several reasons.

1) cleaner workflow
2) easier to fallback to an earlier version (plugins and compliers)
3) more access to platform specific features
4) earlier access to new features (on PGB sometimes it takes months to get a fix)

You should also read this FAQ.
Top Mistakes by Developers new to Cordova/Phonegap

Just advice.
Best of Luck
Jesse