Ionic cordova platform add ios fails! exit code 1

Hello everybody! I am trying to add a platform with the command:
ionic cordova platform add ios

and i got this:

> cordova platform add ios --save
✖ Running command - failed!
[WARN] Platform already added. Saving platforms to config.xml.
> cordova platform save
✖ Running command - failed!
[ERROR] An error occurred while running cordova platform save (exit code 1):

        
        Error: Command failed: /Users/macbookpro/javaScript/_EASE 
        Client/EaseClient/platforms/android/cordova/version
        /bin/sh: /Users/macbookpro/javaScript/_EASE: No such file or directory
        

this is my Ionic Info

cli packages: (/Users/macbookpro/javaScript/_EASE Client/EaseClient/node_modules)

    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 7.0.1 

local packages:

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

System:

    Android SDK Tools : 26.0.2
    Node              : v6.10.3
    npm               : 3.10.10 
    OS                : macOS Sierra
    Xcode             : Xcode 8.3.3 Build version 8E3004b 

Seems like the platform is added but not saved in the config.xml.

Can someone help please?
I have the same problem with : ionic cordova platform add android

Does it work if the path doesn’t contain a space?

Hello Suljan/Jan

yes it works.

but this is weird, last monthe i did another App and the path was :

/Users/macbookpro/javaScript/_EASE Driver App/EaseDriver

and i had no problem.
Anyway thankyou very much!

Yeah, it should be no problem.

Can you run cordova platform add ios --debug directly?

So i removed the ios platform i just added, and put the space back in the path then run :

cordova platform add ios --debug . (without ionic at the beginning)

and it works

MacBook-Pro:javaScript macbookpro$ cd _EASE\ Client/
MacBook-Pro:_EASE Client macbookpro$ cd EaseClient/
MacBook-Pro:EaseClient macbookpro$ cordova platform add ios --debug
Using cordova-fetch for cordova-ios@~4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
	Path: platforms/ios
	Package: com.easets.easeclient
	Name: EASE
iOS project created with cordova-ios@4.4.0
Installing "cordova-plugin-console" for ios
Installing "cordova-plugin-device" for ios
Installing "cordova-plugin-splashscreen" for ios
Installing "cordova-plugin-statusbar" for ios
Installing "cordova-plugin-whitelist" for ios
Installing "cordova-sqlite-storage" for ios
installing external dependencies via npm
npm install of external dependencies ok
Installing "ionic-plugin-keyboard" for ios
--save flag or autosave detected
Saving ios@~4.4.0 into config.xml file ...

Whoah!? That is unexpected and not what I was going for :stuck_out_tongue: Well…

Can you maybe update your Ionic CLI and try again with ionic in front?

1 Like

another thing, after adding the ios, the build was always failing.

i just tried again with:
cordova build ios
and not
ionic cordova build ios and it works

so there is a problem with my ionic CLI right?

with ionic i see this first when i run the build

MacBook-Pro:EaseClient macbookpro$ ionic cordova build ios
[WARN] Detected @ionic/cli-plugin-cordova in your package.json.

       As of CLI 3.8, it is no longer needed. You can uninstall it:
       
       npm uninstall --save-dev --save-exact @ionic/cli-plugin-cordova
       
[WARN] Detected @ionic/cli-plugin-ionic-angular in your package.json.

       As of CLI 3.8, it is no longer needed. You can uninstall it:
       
       npm uninstall --save-dev --save-exact @ionic/cli-plugin-ionic-angular

should i uninstall these plugins?

Yes, please do that. Cleaning up your local Ionic installation is a good idea.

1 Like
MacBook-Pro:EaseClient macbookpro$  npm install -g ionic@latest
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
/usr/local/lib
└── ionic@3.12.0 

commands (add and build) with ionic in front are working now fine.

MacBook-Pro:EaseClient macbookpro$ ionic cordova platform add ios
> cordova platform add ios --save
✔ Running command - done!

So update the CLI was the solution.
Danke!

1 Like