Home > database >  Res folder location in cordova
Res folder location in cordova

Time:07-25

I am trying to add app icons to my Cordova app (android currently):

<platform name="android">    
    <icon src="res/icons/mipmap-ldpi/ic_launcher.png" density="ldpi" />
    <icon src="res/icons/mipmap-mdpi/ic_launcher.png" density="mdpi" />
    <icon src="res/icons/mipmap-hdpi/ic_launcher.png" density="hdpi" />
    <icon src="res/icons/mipmap-xdpi/ic_launcher.png" density="xhdpi" />
    <icon src="res/icons/mipmap-xxdpi/ic_launcher.png" density="xxhdpi" />
    <icon src="res/icons/mipmap-xxxdpi/ic_launcher.png" density="xxhdpi" />
</platform>

I get the error: Source path does not exist: res/icons/mipmap-hdpi/ic_launcher.png

I have tried multiple different paths in config.xml and tried multiple places where to actually put the images, but I haven't seen clearly in any documentation or stackoverflow questions where to actually put the icon files. They seem to need to be in a folder called res but I can't figure out where to put that folder in Cordova.

Edit: I have tried to put the files in:

  • www/
  • www/res/
  • platforms/android/
  • platforms/android/res/
  • platforms/android/platform_www/
  • platforms/android/platform_www/res/

CodePudding user response:

at the same level as www

/www
/res
/platforms/android
  • Related