0

I'm reading Cordova documentation. The version is 3.5.0. In the "Icon and splash screen" section ( here) i read this for the tag :

src: (required) specifies the location of the image file, relative to your www directory

and after

the following configuration can be used to define single default icon which will be used for all platforms.

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

The documentation of edge version (choice from dropdown at top right of window (here)) instead tells:

src: (required) specifies the location of the image file, relative to your project directory

My version is 3.5.0-0.2.7 but the behaviour of build is not the same of that specified in the relative documentation. If i put the png icon in the www directory, when i run emulate command (for android) an error is generated. The error is that Cordova tries to search the app icon in the project root directory and not in the www directory. If i put the icon in the project root directory the emulate command works fine but the app icon doesn't change.

The documentation is wrong?

user3083618
  • 270
  • 1
  • 4
  • 16

3 Answers3

0

try this one..

just put your icon in all the folders inside "project/bin/res" also.

Then add the following line in config.xml under "project/res/xml".

<icon src="icon.png" /> 
Blue_Alien
  • 2,148
  • 2
  • 25
  • 29
  • There are many solution to solve the problem. But the really problem is why the official documentation is wrong. It's very strange. – user3083618 Sep 08 '14 at 19:31
  • @user3083618 no it's not. It is an opensource project. Did you open an issue to mention there was a problem or made a pull request to fix the documentation? – Sebastien Lorber Jul 28 '15 at 12:59
0

Going back to 3.5.0-0.2.4 where the src is relative to the project root instead of www/

Pencilcheck
  • 2,664
  • 3
  • 25
  • 14
0

Yes the documentation is not very good and there are also bugs. Check my FAQ here: https://stackoverflow.com/a/31674547/82609

In particular, declaring the icon without density seems ignored in Android for newer versions.

Community
  • 1
  • 1
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419