I am trying to migrate to cordova-android-11 (from 10.1.2). The only issue I still have is the splashScreen. I understand that I now have to use the splashSCreen api. I tried to do this by creating a new Icon in android studio as described here: https://lessons.livecode.com/m/4069/l/1496759-how-to-create-and-use-adaptive-icons-on-android. I subsequently added the newly created Icon (ic_launcher.xml) to my cordova project, in the resource folder. I added the path to this file as a preference in the config.xml, like so:
However, this gives me 2 build errors. Because the ic_launcher.xml refers to a foreground and a background image:
These do not exist in the Cordova-Android project. Even when I try to add them to my resources, they aren't copied over to my platforms/android folder.
Can someone explain to me which files to add where and more generally how Cordova handles this new splash-api? I can find a lot of documentation from android on how to create the new icons. But all I can find for Cordova-android is to add that preference to the config.xml, but nothing on what that file should contain. How does it handle different pixel densities? The icon says any-dpi, but how does it achieve this in cordova?
Thanks in Advance, Any help here is much appreciated!
How to make adaptive icons: https://developer.android.com/studio/write/image-asset-studio#create-adaptive
relevant SO question: Cordova 11 - Splash Screen - what goes in splashscreen.xml
I think this is deprecated, but it might be helpful in finding a solution: https://www.mathew-paul.nz/posts/cordova-android-adaptive-icons/
(copy to git issue: https://github.com/apache/cordova-android/issues/1528)