1
votes

Got an android app built on cordova 6.4.0. Want to do simple thing- change the icon from the default to my own one. According to the doc all i need to do is to add

<icon src="res/logo.png" />

to config.xml and put my logo file to the path relative to the project's root: [PROJECT_ROOT]/res/logo.png

but when i run

cordova build

the icon does not get replaced.

I understand that the icon must be located in [PROJECT_ROOT]/platforms/android/res/mipmap-*, and i expect the CLI tool to put them there, tough it does not happen.

The tool does generate [PROJECT_ROOT]/res/mipmap-*/icon.png files from the original file, but does not copy them to [PROJECT_ROOT]/platforms/android/res/ which would be natural to expect from my perspective.

Am i doing something wrong?

1
It's a bug in cordova-android 6.0.0, add 6.1.0 with cordova platform add android@latest - jcesarmobile

1 Answers

2
votes

You have to put your icon in www/res folder or you can put it in www folder directly, Then right path for your icon is

<icon src="www/res/logo.png" />

or

<icon src="www/logo.png" />

Because your config.xml is outside of your www folder so this will set your own icon to the app.

So please have a look and let me know if this is working or not.