Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.6.3
-
None
-
None
-
Windows 8
Description
Let's assume I created a fresh project with the following commands:
cd /tmp cordova create test cd test cordova platform add blackberry10
I now want to add an icon to this application. The documentation (http://cordova.apache.org/docs/en/4.0.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens) suggests to add an icon directive to the config.xml, so I'll do that. As the documentation suggests, I reference "res/bb10/icon-86.png" and "res/bb10/icon-150.png". I have no created any files in the file system yet.
When I now run "cordova build", I get several errors:
OliverSalzburg@OLIVER-PC /d/temp/test
$ cordova build
cp: no such file or directory: d:\temp\test\res\bb10\icon-86.png
cp: no such file or directory: d:\temp\test\res\bb10\icon-150.png
Running command: d:\temp\test\platforms\blackberry10\cordova\build.bat
[INFO] Populating application source
[INFO] Parsing config.xml
[INFO] Generating output files
[INFO] Error: Attribute image: file cannot be found in the list of packaged files: res/bb10/icon-86.png
[ERROR] Native Packager exception occurred
[INFO] Error: Attribute image: file cannot be found in the list of packaged files: res/bb10/icon-86.png
[ERROR] Native Packager exception occurred
An error has occurred
Error: d:\temp\test\platforms\blackberry10\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (c:\Users\OliverSalzburg.HARTWIG\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23
)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
The build process expects to see the referenced files relative to the project root. So I'm creating them at the location that cp complained about:
mkdir -p res/bb10 touch res/bb10/icon-86.png touch res/bb10/icon-150.png
Now I build again:
$ cordova build
Running command: d:\temp\test\platforms\blackberry10\cordova\build.bat
[INFO] Populating application source
[INFO] Parsing config.xml
[INFO] Generating output files
[INFO] Error: Attribute image: file cannot be found in the list of packaged files: res/bb10/icon-86.png
[ERROR] Native Packager exception occurred
[INFO] Error: Attribute image: file cannot be found in the list of packaged files: res/bb10/icon-86.png
[ERROR] Native Packager exception occurred
An error has occurred
Error: d:\temp\test\platforms\blackberry10\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (c:\Users\OliverSalzburg.HARTWIG\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23
)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
The package will still complain, because the images still don't exist in the location where it expects it.
If I'm not misunderstanding, the packager complains here because it didn't find the images relative to the platforms www directory. So it's actually looking in platforms/blackberry10/www/res/bb10 for the files. However, the files obviously don't exist there, because the www directory is re-created during build. For the files to exist there, they would have to exist in the projects root www directory.
So, something isn't right here. Either the documentation should say that the icons have to placed in the www directory or the build process should copy them there and place the correct entries in the platforms config.xml.
Attachments
Issue Links
- duplicates
-
CB-6768 Error copying Blackberry10 icons
- Closed