Icon cannot be found on build
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Cordova Ubuntu |
Medium
|
Maxim Ermilov | ||
Bug Description
On Ubuntu 14.10, with a simple cordova app, the build fails because the icon cannot be found. The icon does exist, but I at least could not figure a way to specify it.
$ apt-cache policy cordova-cli
cordova-cli:
Instaŀlat: 4.1.0~ubuntu14.
Candidat: 4.1.0~ubuntu14.
Taula de versió:
*** 4.1.0~ubuntu14.
500 http://
100 /var/lib/
Steps to reproduce:
$ cordova create test-app com.ubuntu.
$ cd test-app
$ cordova platform add ubuntu
$ vi config.xml
<icon src="img/logo.png" />
$ cordova build --device
missing icon element in config.xml
missing icon element in config.xml
Running command: /tmp/test-
Building Phone Application...
Missing icon
Error: /tmp/test-
at ChildProcess.
at ChildProcess.
at maybeClose (child_
at Process.
Now if I edit the config.xml file again, specifying a path not relative to the www dir:
<icon src="www/
$ cordova build --device
Error: icon does not exist: /tmp/test-
at Object.
at Object.
at Object.
at /usr/share/
at Array.map (native)
at /usr/share/
at _fulfilled (/usr/share/
at self.promiseDis
at Promise.
at /usr/share/
| Maxim Ermilov (zaspire) wrote : | #1 |
| Changed in cordova-ubuntu: | |
| assignee: | nobody → Maxim Ermilov (zaspire) |
| importance: | Undecided → Medium |
| David Barth (dbarth) wrote : | #2 |
This has been fixed for a while : https:/
Can you confirm the cordova-cli version you used during those tests ?
| description: | updated |
| Daniel Beck (d-danielbeck) wrote : | #3 |
The problems still exists in the latest version (from today - 2015-05-18). The patch from comment #2 didn't fix the problem:
Manifest.js assumes the icons path is /tmp/project/
It should however be /tmp/project/
I created a pull request correcting the behavior: https:/
| tags: | added: cordova-blocker cordova-workshop |
| Maxim Ermilov (zaspire) wrote : | #4 |
new version uploaded to cordova-ubuntu ppa
| Changed in cordova-ubuntu: | |
| status: | New → Fix Released |
| Daniel Beck (d-danielbeck) wrote : | #5 |
Several ways exist to package an application and reference the icons.
The config.xml file can be in the top-level directory "app/config.xml" (this is the "new" way of packaging an application) or in app/www/config.xml (The "old way, before cordova version 3.3.1, see http://
Starting from that, I identified at least three ways of resolving icons within an app:
1) The "new" way of packaging an app resolves the icon relative to the root of the app: (see link http://
2) Icons can also be resolved relative to the www/res/icons directory. See link: http://
3) Finally, it looks like that when the config.xml file is saved under app/www/, the icons can also be located relative to the app/www directory.
Summarizing: Icons can be located relatively to
- the root-dir app/ [1]
- the dir app/www/res/icons [2]
- the dir app/www [3]
Green Mahjong combines the ways [2] and [3]: https:/

put icon in booth location.