Question

I'm using Cordova CLI 4.2.1 in my project, but I'm unable to get icons working. I've put all the icons as described in the docs into www/res/icons. (Note: Due to the documentation the folder should have already existed with the defaults icons in it, but there wasn't any folder in my projected created via the CLI)

But the icons aren't copied into the bundle after building the app. When searching the web I found a lot of links saying to manually copy them into the projects. This may work but this is pain since this would get done after every build.

Another link on the web told me to add <icon src="res/icons/" /> to my config.xml but this doesn't helped too.

(Another note: The project is created like described in the docs and is just bare bone. So there shouldn't be anything else preventing this from working.)

Was it helpful?

Solution

I was previously using phonegap CLI (3.0 till 3.3) and www/res/icons were here when creating new project but actually not copied to the platforms when creating platform or building. Actually they were used only for phonegap build.

I'm now using cordova 3.4 and www/res is no more created.

The default icons are created by the cli when you add the platform to the project. You can change the icons after you add the platform, the CLI will not touch them when you build, so you only have to to it once for each platform.

OTHER TIPS

The res/icons folder and files are only for the PhoneGap Build service. With Cordova you manually add these after installing the platform to your project.

For iOS you use the functionality that Xcode provides.

For Android you add them in platforms/android/res/drawable and additionally to the other drawable-XXX folders if you wish to support the various display types.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top