/ ionic

Ionic Resource Generation Issues

[[email protected], Cordova 8.0.0]

Ionic CLI has a handy tool to generate icon and splashscreen images for all the various sizes that the IOS and Android platforms require. It's as simple as adding your icon.png and splash.png images to the resources folder and running this command:

ionic cordova resources

or depending on the platform you are developing for:

ionic cordova resources ios or ionic cordova resources android

These commands will generate a bunch of different sized icons and splashscreens and add them to either an ios or android folder within the resources folder.

But sometimes this process can fail with no obvious error. You may get this error:

HTTP Error 400: POST https://res.ionic.io/api/v1/upload
{"Error":"unable to read uploaded image","Width":0,"Height":0,"Type":"png","Vector":false}

This basically means that even though your png files are in the resources folder, the CLI tool can't read them. This is usually because of the way that the file has been exported. When exporting your icon you should make sure that you have interlaced turned off and if you have a save for web option this should turned on. You should also export your icon at least 1024px x 1024px and the splashscreen at least 1200px × 1200px.

Once you have exported the files to the resources folder, run the above command again and you should now see that the icons are generated without issue.