Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred when I was running "ionic cordova platform add ios"

An error occurred when I was running ionic cordova platform add ios.It noticed me with the information

[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add ios --save (exit code 1):

    Using cordova-fetch for cordova-ios@^4.4.0
    Adding zone.js project...
    Error: Your zone.js platform does not have Api.js”

I had tried to update the version of ionic / cordova and also reinstalled node.js and npm.But It still no worked.

Who can tell me how to resolve this problem。Thank you.

like image 241
Kingsley Tong Avatar asked May 28 '17 06:05

Kingsley Tong


2 Answers

This problem had been resolved by using commands

cordova platform rm ios
cordova platform add ios --nofetch
like image 54
Kingsley Tong Avatar answered Jan 23 '23 06:01

Kingsley Tong


Your iOS platform seems to corrupted. Please remove and re-add the platform to resolve the issue using following commands:

cordova platform rm ios

cordova platform add ios

EDIT

If it happens when you try ionic cordova run/build android it will work with the same steps

cordova platform rm android

cordova platform add android

Then run ionic cordova run/build android and it will work.

like image 39
Gandhi Avatar answered Jan 23 '23 08:01

Gandhi