Ionic-cli: Ionic Error: Platform ios already added. but when running resources, says no platform added

Created on 12 Jun 2016  Â·  7Comments  Â·  Source: ionic-team/ionic-cli

_From @LydiaMontagnese on June 11, 2016 22:39_

Short description of the problem:

When I run 'ionic platform add ios', I am getting this error:
Error: Platform ios already added.

But when running 'ionic resources', it says no platform added.

Here's the output:

Lydias-MBP:ionic-basic lydia$ ionic resources
No platforms have been added.
Please add a platform, for example: ionic platform add ios
Or provide a platform name, for example: ionic resources android

Lydias-MBP:ionic-basic lydia$ ionic platform add ios
✗ (node:51934) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Updated the hooks directory to have execute permissions
Error: Platform ios already added.

Lydias-MBP:ionic-basic lydia$

_Copied from original issue: driftyco/ionic#6868_

Most helpful comment

This worked for me.

  1. Go to your app folder
  2. Create the platforms folder
  3. Run the command again
cd yourapp

mkdir platforms

ionic cordova platform add ios

All 7 comments

Hello, thanks for opening an issue with us! Since this issue is an issue with the Ionic CLI and not the framework I will be moving this issue to the correct repo. Thanks for using Ionic!

+1 having the same issue

@irthos I think I fixed my issue by deleting any node-modules or ionic-related files I had in my home (your username) directory. It appears my app thought I already had the platform added because it was added in a project in that directory.

There may be a 'platform' folder above your current directory,

Hi,I have the same problem !!!
$ sudo cordova platform add ios --save
Using cordova-fetch for cordova-ios@^4.4.0
Error: Platform ios already added.

I am working on ionic 3-
There was same issue with me, this caused because I changed app name in config file.
I used these commands-

    cordova plugin save
    cordova platform rm ios
    cordova platform add ios

but error remain same.
I open app/platform/, and saw there was ios file then here is what I did-

  1. Removed ios file (Manually).
  2. Run sudo cordova platform add ios --save
  3. ios platform added for me.

This worked for me.

  1. Go to your app folder
  2. Create the platforms folder
  3. Run the command again
cd yourapp

mkdir platforms

ionic cordova platform add ios
Was this page helpful?
0 / 5 - 0 ratings