Adding custom images for Android with VoltBuilder

I need to add a custom png file to be used as smallicon in cordova-plugin-local-notifications.
I’ve been trying this in config.xml, but it doesn’t work, the resulting apk does not contain the image:

<platform name="android">
    <resource-file src="www/img/icon_72.png" target="res/drawable-hdpi/myres_icon.png" />
    <resource-file src="www/img/icon_192.png" target="res/drawable-mdpi/myres_icon.png" />
    <resource-file src="www/img/icon_512.png" target="res/drawable-xhdpi/myres_icon.png" />

I’m building with: VoltBuilder run android -debug.

I’m pretty sure that that the source files are in the right place, since in my first attempts i got errors about the source of the file.
Now I don’t get any errors, but I find no image in the res folder.


You might try cracking open the apk file and seeing where they ended up. Just rename the .apk to .zip and you can uncompress it to see.

That’s exactly what I did, but I couldn’t find them anywhere.

Do you have the build id for this? I can get the log for you. (You’ll be able to look at it yourself soon)

I think it’s this guid, right?

BTW, for some reason I’m no longer getting a QR code:

Nothing useful in the log either. I will escalate this.

1 Like

Try this:

<resource-file src="www/img/turbo_icon_72.png" target="app/src/main/res/drawable-hdpi/turbo_icon.png" />
<resource-file src="www/img/turbo_icon_192.png" target="app/src/main/res/drawable-mdpi/turbo_icon.png" />
<resource-file src="www/img/turbo_icon_512.png" target="app/src/main/res/drawable-xhdpi/turbo_icon.png" />
1 Like

Yes, it works.
Thanks a lot.