Ionic resources ios gives "images too large for transformation" error

Problem

I succeeded in generating my Android resources using ionic cordova resources android, but ionic cordova resources ios gives an “images too large for transformation” error.

This is what I tried without success

  • Updated Ionic CLI to latest version
  • Removed and added ios platform
  • Checked the image sizes: 1024 x 1024 for icon.png and 2732 x 2732 for splash.png
  • Made sure the images have no alpha transparency

What could be the solution?

(debug) info

Output of ionic cordova resources ios --verbose --force:

[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/the/root/of/my/project', local: false, binPath: 
    '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 1757)
[DEBUG] resourceJsonStructure=3
[DEBUG] platformEngines=android
✔ Collecting resource configuration and source images - done!

? Platform ios not detected. Would you like to install it? Yes
> cordova platform add ios --save
✖ Running command - failed!
[WARN] Platform already added. Saving platforms to config.xml.
> cordova platform save
✔ Running command - done!
[DEBUG] platformEngines=[object Object]
[DEBUG] buildPlatforms=android
[DEBUG] getProjectPlatforms completed - length=1
[DEBUG] imgResources=0
[DEBUG] createImgDestinationDirectories completed - length=0
[DEBUG] getSourceImages completed - 2
✔ Filtering out image resources that do not need regeneration - done!
[DEBUG] uploadSourceImages completed - responses=[
       {},
       {}
    ]
✔ Uploading source images to prepare for transformations - done!
[OK] No need to regenerate images--images too large for transformation.

Note: it keeps complaining about the missing ios platform, while in fact it has been installed.

This is my Ionic information:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 1.3.0
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.4.0

System:

    ios-deploy : 1.9.0 
    ios-sim    : 5.0.13 
    Node       : v6.9.4
    npm        : 3.10.10 
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b

I’m seeing the same problem with the same configuration. Were you able to resolve it?

Why sudo in the command?

@joelm222 please also include your ionic info output.

I use sudo because otherwise it misses privileges to write the files. For Android this works correctly.
I just removed sudo from my question.

I was able to resolve the problem by resetting my node back to v7.9.0 using nvm.
I went back to v7.9.0, created the images, reset to v8.4.0 and did the cordova platform add android and it worked.

This is not a real solution but it got me working!

This shouldn’t really be necessary, if it is something went wrong along the way.

Does it work if you replace the files with smaller ones? Or the default resources from GitHub - ionic-team/ionic-default-resources: Default resources for icons and splash screens?

Android resources worked fine. My problem is with ios resources.

I tried this. Unfortunately working with the default resources gives the same error.

Create a new project with ionic start and try there. Does it work?

I think you should get this fixed. My guess is that it also is causing the problems you are seeing. Probably create a new checkout of your project where you add the platforms in a new folder.

Yes, that works. And I tried to create the resources of my project in this new project and that works as well. So, I will start a clean project for my project and continue from there. Thanks for your support.

1 Like