Error occurred while copying resources/android/icon/mdpi-foreground.png

0
842

I ran into the same error in a new Ionic Capacitor@2.4.7 project. I had the splash.png and icon.png in the resources directory. But those aren’t enough. The error is related to the Adaptive Icons section for cordova-res. 2 more icons are missing in your resources directory.

  1. Add the required icon-foreground.png and icon-background.png to the resources/android directory
  2. (Optional) Check if cordova-res is the latest. For me I upgraded to version 0.15.3 on a mac with this commands: sudo npm -g remove cordova-res and then sudo npm -g install cordova-res --unsafe-perm
  3. Re-run the command:
cordova-res android --skip-config --copy
  • Successful output now looks like (the 18 changed to 24):
Generated 24 resources for Android
Copied 31 resource items to Android

LEAVE A REPLY

Please enter your comment!
Please enter your name here