When I run ionic cordova build ios
the output is as follows
> cordova platform add ios --save
Using cordova-fetch for cordova-ios@3.9.0
Adding ios project...
iOS project created with cordova-ios@3.9.0
Unable to load PlatformApi from platform. Error: Unhandled "error" event. (Does not appear to implement platform Api.)
(node:22344) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unhandled "error" event. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
(node:22344) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[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 -D @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 -D @ionic/cli-plugin-ionic-angular
Running app-scripts build: --platform ios --target cordova
[18:39:11] build dev started ...
[18:39:11] clean started ...
[18:39:11] clean finished in 2 ms
[18:39:11] copy started ...
[18:39:11] transpile started ...
[18:39:14] transpile finished in 2.15 s
[18:39:14] preprocess started ...
[18:39:14] deeplinks started ...
[18:39:14] deeplinks finished in 28 ms
[18:39:14] preprocess finished in 29 ms
[18:39:14] webpack started ...
[18:39:14] copy finished in 2.31 s
[18:39:20] webpack finished in 5.92 s
[18:39:20] sass started ...
[18:39:20] sass finished in 762 ms
[18:39:20] postprocess started ...
[18:39:20] removed unused font files
[18:39:20] postprocess finished in 5 ms
[18:39:20] lint started ...
[18:39:20] build dev finished in 8.94 s
> cordova build ios
(node:22358) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: No platforms added to this project. Please use `cordova platform add <platform>`.
(node:22358) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[18:39:22] lint finished in 1.55 s
From reading the error message it says Please use cordova platform add <platform>
So I run cordova platform add ios
I get
Adding ios project...
Unable to load PlatformApi from platform. Error: Unhandled "error" event. (Does not appear to implement platform Api.)
Error: Project already exists
I have no idea what to do? Ive been hitting my head against the wall for a couple hours on this.