You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "igorsantos07 (via GitHub)" <gi...@apache.org> on 2023/09/20 04:30:56 UTC
[GitHub] [cordova-android] igorsantos07 opened a new issue, #1669: Splashscreen logo not showing on OnePlus 7t
igorsantos07 opened a new issue, #1669:
URL: https://github.com/apache/cordova-android/issues/1669
# Bug Report
This is the same as #1579, except I'm using Android 12 on an OnePlus 7t instead of a Realme.
## Problem
Splash screen shows just the background color, no icon whatsoever.
### What is expected to happen?
Migration to cordova-android 12 should go smooth, without having to do guesswork on migrating the splashscreen or why the heck the icon is never showing up.
### What does actually happen?
OnePlus splashes just with the background color. A Samsung tablet with Android 11, though, works just fine*.
Honestly, while the previous user decided to just abandon the bug report, I think this is an important problem since it actually makes our Cordova app *unreliable*. A splashscreen without any text or icon, even though it's colored, looks like a broken app for the user. The moment they click the icon, they _want_ to see something, and seeing just a blank/colored screen is confusing - specially if we're downloading a new payload, which could make the splashscreen hang for more time than the user would bear an empty screen.
> \* I realized I should try other devices only after I gave up and started googling for splash screen problems on cordova 12, and then found #1579; sadly, **I had spent almost a day trying to figure out what I was doing wrong**, since documentation is really lacking on that part. Specifically, it's missing an explanation on what formats are acceptable for the icon, since it looks like it only works with an XML file (from unknown origin, had to google to find how to create one) but it actually accepts the old PNG, as long as it has the proper padding. There's also no clear path of migration from the previous `<splash>` tags, not even in the announcement blog post - you have to read through the original Android documentation to piece stuff out, that's totally frustrating.
### Command or Code
Showing here the relevant(?) parts of `config.xml`:
```xml
<engine name="android" spec="^12.0.1" />
<platform name="android">
<preference name="android-targetSdkVersion" value="33" />
<!-- TODO overrides cordova-plugin-push's requirement of 1.5.20, which causes some deprecation errors -->
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinVersion" value="1.7.21" />
<preference name="AndroidWindowSplashScreenBackground" value="#F8B61D" />
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/drawable/bot.xml" />
<!-- preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/drawable/bot.png" /-->
</platform>
<preference name="AutoHideSplashScreen" value="false" />
```
### Environment, Platform, Device
Affected device: Android 12, [OnePlus 7t](https://www.gsmarena.com/oneplus_7t-9816.php)
Working device: Android 11, [Samsung SM-P205](https://www.gsmarena.com/samsung_galaxy_tab_a_8_0_&_s_pen_(2019)-9651.php)
I also tested on an [ancient Moto G4 Play](https://www.gsmarena.com/motorola_moto_g4_play-8104.php#xt1603) running Android 7, it also works fine, if this is of any help :joy:
### Version information
Cordova CLI 12.0.0 (cordova-lib 12.0.1)
Cordova-android 12.0.1
Target Android SDK: API 33
Linux Mint Uma 20.2
Android Studio Giraffe (only used to generate the vector XML, but could be used for debugging if necessary, I guess?)
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-2191637354
> hence why I was looking for a way to have only 1 splash, meaning the one with the full image.
Unfortunately this is no longer possible starting with Android 12.
I wasn't aware that google started producing warnings if they detect 2 splash screens, so that's good to know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-1758613260
> And guess what? The splash icons don't show in the standard Play Services API 32 image!
You could be experiencing an android quirk: https://cordova.apache.org/docs/en/12.x/core/features/splashscreen/index.html#android
> Android 12 does not show the splash screen when launching the application from Android Studio or Cordova CLI. This is a known Android 12 issue. After uploading the app to the device or simulator, exiting and opening the app will show the Splash Screen. If changes are not shown, try also performing a clean build. It has been fixed on Android 13.
To be sure, try closing the app and relaunching it directly on the device. The bug seems to only trigger (sometimes) when launching through Android Studio/CLI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-2191570477
@Boeblahoebla your splashscreen is not supported and goes against android's splashscreen guidelines. Android's standardised splashscreens only allow for an image roughly the size of the app icon with a flat colour background. It's heavily opinionated because they want to control the look and feel of the launching of the apps for a consistent experience. I know it's dumb, but that's how android's splashscreen system works.
These links are provided in the cordova docs as well but you can see the anatomy of the android splashscreen [here](https://developer.android.com/develop/ui/views/launch/splash-screen#splash_screen_dimensions).
Cordova enables the "icon with background color" so the following applies:
> App icon with an icon background: this must be 240×240 dp and fit within a circle 160 dp in diameter.
So the splashscreen graphic must fit within a 160x160dp circle of a 240x240dp canvas. See Figure 2 for an example graphic. If you're authoring rasterized images like a PNG, then multiply all dp values by 4 for your resolution, otherwise the images will look blurry on high-res devices. So the spashscreen PNG asset should be 960x960 canvas size, with the content fitting inside a centered circle that is 640x640.
Android also allows you to control the colour of the background, but it must be a colour resource. So basically you can only use flat colours.
Lastly the third part that android allows you edit is the branding image, which is a slightly larger image that can appear on the bottom of the splashscreen. Cordova however doesn't currently support this [feature](https://cordova.apache.org/docs/en/12.x/core/features/splashscreen/index.html#androidwindowsplashscreenbrandingimage). Additionally Android doesn't support this feature on older devices that has splashscreen implemented via the compatibility library. In other words, it's only available on Android 12 devices and later.
Historically, cordova android did support full screen splashscreens because we had our own splashscreen implementation, which we dropped support when android had their own implementation, which forced on Android 12+. Apps implementing a custom splashscreen view would see the "native" android splashscreen followed by the app's custom splashscreen. This is why Cordova dropped support for full size splashsceens and decided to only operate within Android's splashscreen splashscreen.
If you want to follow the native splashscreen with your own "splashscreen", then you can mimic that behaviour directly within the webview. Just know that the native splashscreen is not replaceable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "Boeblahoebla (via GitHub)" <gi...@apache.org>.
Boeblahoebla commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-2191627306
Thank you so much for your swift reply.
What you suggested last, I was able to do this, but in the pre-launch report of my app, I get 2 notices that there are 2 splash pages & I wanted to clear them out, hence why I was looking for a way to have only 1 splash, meaning the one with the full image.

You have helped confirm what I started to suspect, so I can't thank you enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "igorsantos07 (via GitHub)" <gi...@apache.org>.
igorsantos07 closed issue #1669: Splashscreen logo not showing on Android 12
URL: https://github.com/apache/cordova-android/issues/1669
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1669: Splashscreen logo not showing on OnePlus 7t
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-1727772267
Providing the icon resources you have tried might help us determine if the icon itself is being authored incorrectly.
I've recently used Android Studio to convert a SVG into a Android vector and I did notice that creating a "Vector" asset doesn't work as expected. In fact using the DP values as suggested by Google itself doesn't actually work as expected because the scale seems to be wrong. Importing an Image asset however allows you get the vector XML file with a preview, and that seems to do what you'd expect.
The [docs](https://cordova.apache.org/docs/en/12.x/core/features/splashscreen/index.html#androidwindowsplashscreenanimatedicon) does state that you can use a PNG however, in which case you'll probably want to scale your PNG up to xxxhpdi density, which is 4x the base "dp" unit.
Cordova enables icon with background so the following applies:
> App icon with an icon background: this must be 240×240 dp and fit within a circle 160 dp in diameter.
That means if you author a PNG, you should multiply the dp units by 4, so your canvas size should be 960x960px and your icon content should not leave 640x640px diameter circle that is centered.
I've attached an inkscape template that shows what I mean, the circular area is the "visible" area of the icon. Outside of the circle is masked away. [androidSplashIconTemplate.svg](https://github.com/apache/cordova-android/assets/11200662/25d961b9-8e7f-4a62-80cc-4f0237ac343d)
And yes, I do agree that the docs could probably be a bit more clear on some of these details, but hopefully this will help you get going at the very least.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on OnePlus 7t [cordova-android]
Posted by "igorsantos07 (via GitHub)" <gi...@apache.org>.
igorsantos07 commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-1752333360
Thanks for the thorough explanation! Sorry for taking a while to respond, I moved on with other tasks guessing this was an edge case, and soon after left for vacations.
I'm back now with good news / bad news.
The good news is: I found a reproducible scenario.
The bad news is: this seems a bit more widespread?
Since I have no Android 13 and needed to test some possible push problems from the dead `havesource` plugin fork, I created a couple of emulators... And guess what? The splash icons don't show in the standard Play Services API 32 image! Not even the standard Cordova icon shows up, it's just a blank splash screen, with the correct background color though. It also seems to work fine on Android 11.
I tested that out in four different scenarios:
- the generated XML from before
- the old xxxhdpi PNG we were using before the Cordova upgrade
- an invalid file path
- [a random PNG I got from Google's CC image search](https://freesvg.org/img/sample2.png) (wasn't properly edited to fit the space, so cropping is expected, I just wanted to know if it was a problem with my image files or not)
```xml
<preference name="AndroidWindowSplashScreenBackground" value="#F0F000" />
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/drawable/invalid.png" />
```
Random PNG, Android 13:

invalid path, Android 13:

invalid path or random PNG, Android 12:

Random PNG, Android 11 (also worked fine with our Vector XML):

> The screenshots show "Galaxy Tab A8" but that's just the screen ratio for my usual test tablet, there's nothing non-standard on these emulators' hardware profile. I created both in succession, just changing the API Level, and ran the exact same code to take the screenshots above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Splashscreen logo not showing on Android 12 [cordova-android]
Posted by "igorsantos07 (via GitHub)" <gi...@apache.org>.
igorsantos07 commented on issue #1669:
URL: https://github.com/apache/cordova-android/issues/1669#issuecomment-1758678609
Dang, you're right. Sorry for the trouble, thanks for the heads up!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org