I'm trying to change the icon of the aplication I'm building with Cordova through Eclipse.
I've tried 2 different methods, which both failed. I first tried to add the following kind of lines to my projroot/www/config.xml:
<icon src="icon.png" alsoAddedOtherParameters />
Which results in:
[aapt] C:\Program Files (x86)\eclipse\configuration\org.eclipse.osgi\920\data\proj_gen\csam.test\android\bin\AndroidManifest.xml:26: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').
BUILD FAILED
C:\Users\Pieter\AppData\Local\Android\android-sdk\tools\ant\build.xml:649: The following error occurred while executing this line:
C:\Users\Pieter\AppData\Local\Android\android-sdk\tools\ant\build.xml:694: null returned: 1
I also found a second approach through hooks. But this just didn't change anything. Below is a screenshot of my filestructure and below you can find the hook script. Maybe the hook script doesn't get executed when building through eclipse?
#!/usr/bin/env node
//
// This hook copies various resource files
// from our version control system directories
// into the appropriate platform specific location
//
// configure all the files to copy.
// Key of object is the source file,
// value is the destination location.
// It's fine to put all platforms' icons
// and splash screen files here, even if
// we don't build for all platforms
// on each developer's box.
var filestocopy = [{
"config/android/res/drawable/icon.png":
"platforms/android/res/drawable/icon.png"
}, {
"config/android/res/drawable-hdpi/icon.png":
"platforms/android/res/drawable-hdpi/icon.png"
}, {
"config/android/res/drawable-mdpi/icon.png":
"platforms/android/res/drawable-mdpi/icon.png"
}, {
"config/android/res/drawable-xhdpi/icon.png":
"platforms/android/res/drawable-xhdpi/icon.png"
}, ];
var fs = require('fs');
var path = require('path');
// no need to configure below
var rootdir = process.argv[2];
filestocopy.forEach(function(obj) {
Object.keys(obj).forEach(function(key) {
var val = obj[key];
var srcfile = path.join(rootdir, key);
var destfile = path.join(rootdir, val);
//console.log("copying "+srcfile+" to "+destfile);
var destdir = path.dirname(destfile);
if (fs.existsSync(srcfile) && fs.existsSync(destdir)) {
fs.createReadStream(srcfile).pipe(
fs.createWriteStream(destfile));
}
});
});