james lebron
james lebron

Reputation: 109

Cordova icon keep showing the default icon

I tried so many steps but the problem still persist. In AndroidManifest.xml I set my icon in the fields of icon and logo, it still run the default cordova icon.

later I tried to add in config.xml, <icon src="res/drawable/icon.png" /> the problem is still there.

I'm using ionic framework, not sure it's ionic problem or cordova problem. I spend hours finding a solution.

Upvotes: 4

Views: 1792

Answers (3)

Kris Randall
Kris Randall

Reputation: 736

Mobile apps (both iOS and Android) require many different icons; identical but different resolutions. In the past these needed to be manually created and given the correct names - a tedious process.

However it is much easier now :

OR

  • You can also use the npm module for Cordova $ cordova-icon which does the same thing with a file called "icon.png" in your app root folder.
    To install 'cordova-icon' simply use $ npm install -g cordova-icon https://www.npmjs.com/package/cordova-icon

For both the ionic resources or the cordova-icon solutions you will need image magic installed :
eg. $ brew install imagemagick
(I don't have enough reputation to post a link to the imagemagick site)

Upvotes: 1

Sebastien Lorber
Sebastien Lorber

Reputation: 92140

See my FAQ here: https://stackoverflow.com/a/31674547/82609

For Cordova 5.1.1 and Android, the icon declaration does not do anything when used without density. You have to declare all the densities to make it work.

Upvotes: 0

Nurdin
Nurdin

Reputation: 23883

You need to build your project again. Cd to your project and build it using command below.

Phonegap: phonegap build android

Cordova: cordova build android

Upvotes: 0

Related Questions