Search code examples
androidcordovaandroid-icons

Why does Phonegap replace my icon?


I've followed tutorials and solutions to Phonegap icon issues here on SO. From what I'm reading it looks like, if I'm building locally, I need to replace the PG icons in platforms/android/res/drawable (there are 3 diff folders in drawable that contain the icon) with my own. That is what I am doing. Here's where it gets weird. I replace these icons with my own (different icon, same name), then go to Terminal and do phonegap build android, and then if I navigate back to the drawables folders I see that my new icons have been replaced yet again with the default Phonegap robot icons. What am I missing?


Solution

  • The answer was in fact to use this code block in config.xml at the root level (same level as www directory):

    <icon src="www/res/icon/android/ldpi.png" platform="android" density="ldpi" />
    <icon src="www/res/icon/android/mdpi.png" platform="android" density="mdpi" />
    <icon src="www/res/icon/android/hdpi.png" platform="android" density="hdpi" />
    <icon src="www/res/icon/android/xhdpi.png" platform="android" density="xhdpi" />
    <icon src="www/res/icon/android/xxhdpi.png" platform="android" density="xxhdpi" />
    <icon src="www/res/icon/android/xxxhdpi.png" platform="android" density="xxxhdpi"/>
    

    Making sure, obviously, that those paths lead to your icons.