Search code examples
androidcordovaiconssplash-screenvisual-studio-cordova

Custom RES SCREENS and RES ICONS get replaced with default Cordova screen and icon


I'm using Visual Studio tools for Apache Cordova.

I've tested the CLI 6.4.0 and unfortunately there is a bug with the RES SCREENS and RES ICONS. If I use CLI 6.3.1 this issue disappears. To demonstrate it I've created a new project from scratch, added only the cordova-plugin-splashscreen (ver 4.0.0) and replaced the original screen images with custom ones.

The issue happens when I try to debug with a physical android device connected via USB.

On build the system automatically creates some extra folders/files (one new folder/file for each splash configuration I have in my config.xml), so in my case I get these new folders/files:

  • res/drawable-land-hdpi/screen.png
  • res/drawable-land-ldpi/screen.png
  • res/drawable-land-mdpi/screen.png
  • res/drawable-land-xdpi/screen.png
  • res/drawable-port-hdpi/screen.png
  • res/drawable-port-ldpi/screen.png
  • res/drawable-port-mdpi/screen.png
  • res/drawable-port-xdpi/screen.png



The PNG files reflects what I have in my RES/SCREENS/ANDROID folders.

At the same time the build copies these new folders (described above) to the PLATFORMS/ANDROID/RES folder. The issue is the images inside those folders are not the original ones I have chosen in my project, but they are the Cordova Logo (the one that is added by default when a new project is created).



Solution

  • Thanks Elvis for pointing it out! Your bug report has been closed because it's a duplicate issue.

    Here is the link to the official bug report: https://issues.apache.org/jira/browse/CB-12077

    And here is the GitHub Pull Request: https://github.com/apache/cordova-android/pull/343