Ionic resource error

× Uploading source images to prepare for transformations - failed!
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}

Failed to convert the icons and splash screen images

take images for icon and splash…Image should be PNG (icon size should be 1024 * 1024 and splash should be 2732 * 2732 if selected image is square)

ionic resources android --force
ionic resources ios --force

Try this…It is working for me

2 Likes

I too tried these pixel image but shows an error

what error is showing?

1 Like

image cannot converted above error i mentioned

can I see which steps you are following??

yeah …!!

first : I copied the image into resource folder replace the icon and splash .png images

second step: ionic cordova resources

     And also tried    ionic cordova resources android --force

                        ionic cordova resources --icon

try this same for ios also
ionic cordova resources android --force

after that update platforms
It is workable…I don’t know how it is not working in your resource

even i tried in ios also adding the ios platform again doing it ios but again shows the same error @shivani8710

Create a new project with ionic start blank blank. This will have two current example images. Copy these over to your project and run the command. If this works, your images were broken or in the wrong size. Fix that.

yeah its work.But how to convert my custom icon and resources i tried ionic resources command.

Make your files be the same dimensions as these files.

1 Like

I also suggested same solution :joy::joy::joy::joy:

If you guys generating the resources from Sketch App. Just open the images in Photoshop or any other image editor and just save and try again. This worked me :slight_smile:

6 Likes

Just had the same issue with filed exported in the newest version of sketch. So I opened in an older version and exported again and it worked (Sketch 46.2)

4 Likes

It could be related to your png settings. For me, having saved it through Photoshop’s ‘Save for web’ solved the issue.

2 Likes

I have resized with resize tool and give 1024x1024 with .png format with bigger size then ionic cordova resources --icon working

4 Likes

the best solution to the error, thanks!

Done it with regular paint , but it was the ONLY solution here… Thanks!

Interlaced images will also give this error. Resaving it as non-interlaced can fix, see: https://stackoverflow.com/questions/49596147/ionic-cordova-resources-splash-screen-not-working