"Platform IOS already added" error now appearing on IOS package builds

A recent change to Ionic pro’s package build is causing this error during this fastlane step:
cordova platform add ios --nofetch

Exit status of command ‘cordova platform add ios --nofetch’ was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Error: Platform ios already added.

This can be fixed by ensuring ios is not an platform in config.xml but this isn’t practical.

Broken fastlane summary on Wednesday June 20th:
±-----±-----------------------------------±------------+
| fastlane summary |
±-----±-----------------------------------±------------+
| Step | Action | Time (in s) |
±-----±-----------------------------------±------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 4 |
| 3 | create_keychain | 0 |
| 4 | download_certs | 2 |
| 5 | import_certificate | 0 |
| 6 | build_pro_app | 294 |
| :boom: | cordova platform add ios --nofetch | 3 |
| 8 | upload_logs | 0 |
| 9 | shell command | 0 |
| 10 | delete_keychain | 0 |
±-----±-----------------------------------±------------+

Working Fastlane summary on Monday 18th June:
±-----±-----------------------------------±------------+
| fastlane summary |
±-----±-----------------------------------±------------+
| Step | Action | Time (in s) |
±-----±-----------------------------------±------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 5 |
| 3 | download_www | 4 |
| 4 | create_keychain | 0 |
| 5 | download_certs | 2 |
| 6 | import_certificate | 0 |
| 7 | npm install --quiet | 37 |
| 8 | cordova platform add ios --nofetch | 11 |
| 9 | update_project_codesigning | 0 |
| 10 | update_project_provisioning | 0 |
| 11 | gym | 80 |
| 12 | upload_ipa | 2 |
| 13 | upload_logs | 1 |
| 14 | shell command | 0 |
| 15 | delete_keychain | 0 |
±-----±-----------------------------------±------------+

I’ve same problem, have you solved ?
thanks

To get around the problem i removed the ios platform with:

cordova platform remove ios

and then committed the code to git and sent to ionic:

git push ionic master

Note: for ionic pro to correctly build i had to have at least one platform added. So:

cordova platform add android

I’m not sure if the ionic team are monitoring the forums for these type of issues (@mhartington ?)

Thanks for replay, i submitted now a request to https://ionic.zendesk.com/hc/en-us

Had the same issue today. Previously the project worked fine, now it started failing on Ionic Pro because platform ios already exists.
Removing the platform, as @tarnawsky suggested, didn’t help me.

What helped was selecting XCode 9 instead of XCode 10 when starting the package build in Ionic Pro. Looks like a bug, doesn’t it?

1 Like

Hey @whizai

Ran into the same issue just as of today. I tried changing the build to XCode 9 and it still gave me the same error, I even removed the IOS from the config as well and the same issue occurred, I don’t really know whats up, but this issue is preventing me to get another build up for my beta users on my app.

Any suggestions or ideas of trying?

Here is the exact Error I get on the IOS build using XCode 9 and the ios platform not in my config.

[17:59:16]: --------------------------------------
[17:59:16]: --- Step: cordova platform add ios ---
[17:59:16]: --------------------------------------
[17:59:16]: $ cordova platform add ios
[17:59:17]: ▸ Using cordova-fetch for cordova-ios@~4.5.4
[17:59:43]: ▸ Adding ios project...
[17:59:43]: ▸ Creating Cordova project for the iOS platform:
[17:59:43]: ▸ Path: platforms/ios
[17:59:43]: ▸ Package: com.dev.mtime
[17:59:43]: ▸ Name: mtime_mobile
[17:59:43]: ▸ iOS project created with cordova-ios@4.5.5
[17:59:44]: ▸ Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
[18:00:08]: ▸ Installing "cordova-plugin-whitelist" for ios
[18:00:08]: ▸ Adding cordova-plugin-whitelist to package.json
[18:00:08]: ▸ Saved plugin info for "cordova-plugin-whitelist" to config.xml
[18:00:08]: ▸ Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
[18:00:32]: ▸ Installing "cordova-plugin-statusbar" for ios
[18:00:32]: ▸ Adding cordova-plugin-statusbar to package.json
[18:00:32]: ▸ Saved plugin info for "cordova-plugin-statusbar" to config.xml
[18:00:32]: ▸ Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
[18:00:56]: ▸ Installing "cordova-plugin-device" for ios
[18:00:56]: ▸ Adding cordova-plugin-device to package.json
[18:00:56]: ▸ Saved plugin info for "cordova-plugin-device" to config.xml
[18:00:56]: ▸ Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
[18:01:21]: ▸ Installing "cordova-plugin-splashscreen" for ios
[18:01:21]: ▸ Adding cordova-plugin-splashscreen to package.json
[18:01:21]: ▸ Saved plugin info for "cordova-plugin-splashscreen" to config.xml
[18:01:21]: ▸ Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
[18:01:45]: ▸ Installing "cordova-plugin-ionic-webview" for ios
[18:01:46]: ▸ Adding cordova-plugin-ionic-webview to package.json
[18:01:46]: ▸ Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
[18:01:46]: ▸ Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
[18:02:10]: ▸ Installing "cordova-plugin-ionic-keyboard" for ios
[18:02:10]: ▸ Adding cordova-plugin-ionic-keyboard to package.json
[18:02:10]: ▸ Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
[18:02:10]: ▸ Discovered plugin "cordova-plugin-ionic" in config.xml. Adding it to the project
[18:02:35]: ▸ Installing "cordova-plugin-ionic" for ios
[18:02:35]: ▸ Plugin dependency "cordova-plugin-splashscreen@5.0.2" already fetched, using that version.
[18:02:35]: ▸ Dependent plugin "cordova-plugin-splashscreen" already installed on ios.
[18:02:35]: ▸ Failed to install 'cordova-plugin-ionic': CordovaError: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
[18:02:35]: ▸ at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
[18:02:35]: ▸ at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
[18:02:35]: ▸ at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
[18:02:35]: ▸ at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
[18:02:35]: ▸ at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
[18:02:35]: ▸ at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
[18:02:35]: ▸ at _combinedTickCallback (internal/process/next_tick.js:131:7)
[18:02:35]: ▸ at process._tickCallback (internal/process/next_tick.js:180:9)
[18:02:35]: ▸ Failed to restore plugin "cordova-plugin-ionic" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
[18:02:35]: ▸ --save flag or autosave detected
[18:02:35]: ▸ Saving ios@~4.5.5 into config.xml file ...
[18:02:36]: -------------------------
[18:02:36]: --- Step: upload_logs ---
[18:02:36]: -------------------------
[18:02:40]: ---------------------------
[18:02:40]: --- Step: shell command ---
[18:02:40]: ---------------------------
[18:02:40]: -----------------------------
[18:02:40]: --- Step: delete_keychain ---
[18:02:40]: -----------------------------
[18:02:40]: Exit status of command 'cordova platform add ios' was 1 instead of 0.
Using cordova-fetch for cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
	Path: platforms/ios
	Package: com.dev.mtime
	Name: mtime_mobile
iOS project created with cordova-ios@4.5.5
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for ios
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for ios
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for ios
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for ios
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for ios
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
Discovered plugin "cordova-plugin-ionic" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic" for ios
Plugin dependency "cordova-plugin-splashscreen@5.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-splashscreen" already installed on ios.
Failed to install 'cordova-plugin-ionic': CordovaError: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to restore plugin "cordova-plugin-ionic" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
--save flag or autosave detected
Saving ios@~4.5.5 into config.xml file ...

+-------------------------------------+-------------------------------------------------------------------------------------+
|                                                       Lane Context                                                        |
+-------------------------------------+-------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM                    | ios                                                                                 |
| PLATFORM_NAME                       | ios                                                                                 |
| LANE_NAME                           | ios package_build                                                                   |
| DOWNLOAD_CERTS_CODESIGNING_IDENTITY | iPhone Developer: Greggory J Steele (84F2KGD5KB)                                    |
| DOWNLOAD_CERTS_TEAM_ID              | LEW55T6SY4                                                                          |
| DOWNLOAD_CERTS_PROJECT_NAME         | mtime_mobile                                                                        |
| DOWNLOAD_CERTS_CERT_PATH            | /Users/ionic/builds/JonathanFSteele/mtime_mobile/cert_file.p12                      |
| DOWNLOAD_CERTS_PROVISIONING_PATH    | /Users/ionic/builds/JonathanFSteele/mtime_mobile/provision_file.mobileprovision     |
| SIGH_PROFILE_PATHS                  | ["/Users/ionic/builds/JonathanFSteele/mtime_mobile/provision_file.mobileprovision"] |
+-------------------------------------+-------------------------------------------------------------------------------------+
[18:02:40]: Exit status of command 'cordova platform add ios' was 1 instead of 0.
Using cordova-fetch for cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
	Path: platforms/ios
	Package: com.dev.mtime
	Name: mtime_mobile
iOS project created with cordova-ios@4.5.5
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for ios
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for ios
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for ios
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for ios
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for ios
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
Discovered plugin "cordova-plugin-ionic" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic" for ios
Plugin dependency "cordova-plugin-splashscreen@5.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-splashscreen" already installed on ios.
Failed to install 'cordova-plugin-ionic': CordovaError: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to restore plugin "cordova-plugin-ionic" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
--save flag or autosave detected
Saving ios@~4.5.5 into config.xml file ...


+------+--------------------------+-------------+
|               fastlane summary                |
+------+--------------------------+-------------+
| Step | Action                   | Time (in s) |
+------+--------------------------+-------------+
| 1    | default_platform         | 0           |
| 2    | build_summary            | 4           |
| 3    | add_git_credentials      | 0           |
| 4    | modify_config_xml        | 0           |
| 5    | create_keychain          | 0           |
| 6    | download_certs           | 2           |
| 7    | import_certificate       | 0           |
| 8    | build_pro_app            | 70          |
| 9    | add_cordova_to_index     | 0           |
| 💥   | cordova platform add ios | 199         |
| 11   | upload_logs              | 4           |
| 12   | shell command            | 0           |
| 13   | delete_keychain          | 0           |
+------+--------------------------+-------------+

[18:02:40]: fastlane finished with errors
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.4
/Users/ionic/.fastlane/bin/bundle/bin/fastlane: [!] Exit status of command 'cordova platform add ios' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Using cordova-fetch for cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
	Path: platforms/ios
	Package: com.dev.mtime
	Name: mtime_mobile
iOS project created with cordova-ios@4.5.5
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for ios
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for ios
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for ios
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for ios
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for ios
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
Discovered plugin "cordova-plugin-ionic" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic" for ios
Plugin dependency "cordova-plugin-splashscreen@5.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-splashscreen" already installed on ios.
Failed to install 'cordova-plugin-ionic': CordovaError: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to restore plugin "cordova-plugin-ionic" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-ionic-webview@3.1.2" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@^2.1.4". Try --force to use installed plugin as dependency.
--save flag or autosave detected
Saving ios@~4.5.5 into config.xml file ...

\e[91mFailed to upload ipa to storage please retry your build.\e[0m
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: Process exited with: 1. Reason was:  ()

@shaderock18, why do you think it is the same issue? I don’t see Platform ios already added error in your logs.

Your error is here:

Failed to install ‘cordova-plugin-ionic’: CordovaError: Version of installed plugin: “cordova-plugin-ionic-webview@3.1.2” does not satisfy dependency plugin requirement “cordova-plugin-ionic-webview@^2.1.4”. Try --force to use installed plugin as dependency.

Search out for the solution to this specific error.

@whizai, Ah now looking at the error a little closer I see that it does relate to a different issue. Thanks.