Cordoba CLI: An error occurred while creating the ios subproject

I tested the CLI Cordova 3.0.0 tool. Team

$ sudo cordova platform add android 

done ok. But I have a mistake during the command

 $ sudo cordova platform add ios 

Mistake

 [Error: An error occured during creation of ios sub-project. /bin/sh: /Users/user/.cordova/lib/ios/cordova/3.0.0/bin/create: No such file or directory ] 

When I decided to install the previous version

 $ sudo npm install -g cordova@2.9.0 

Yes, -

 $ cordova platform add ios 
Team

completed her work. I got ios subproject

I have Xcode 4.6.3 and xCode command line tools installed. Thank you in advance for any hint.

By the way, I am not alone with such a problem. Please see "CLI PhoneGap": "Error while creating ios subproject" https://groups.google.com/forum/#!msg/phonegap/woWZzT39osg/CpK_rUIKmYAJ

Update: Bugfix: the folder with the version was deleted ie

 rm -rf ~/.cordova/lib/ios/cordova/3.0.0/ 

and after

 $ sudo cordova platform add ios 

ios platform was added without errors.

+7
cordova cordova-cli
source share
4 answers

I had this problem after killing the previous cordova platform add command, not letting it finish. It appears that he partially downloaded the platform files, but terminating it left him in an inconsistent state. As you mentioned, deleting this directory and then re-executing the command resolved the issue.

 rm -rf ~/.cordova/lib/ios/cordova/3.0.0/ cordova platform add ios 

By the way, you do not need to use sudo here. It would be better to run these commands as a regular user.

+10
source share

I had the same problem and if you also follow PhoneGap 3.0 Command Line Interface documentation and created the project by calling

 $ cordova create HelloWorld com.example.hello "Hello World" 

Then try to remove the space between Hello World.

 $ cordova create HelloWorld com.example.hello "HelloWorld" 

The reason this failed when adding the Android platform is because the team is trying to create an Activity with "Hello World". Therefore, removing a space will solve this problem.

+7
source share

Sometimes this error occurs on Windows when the PATH variable is incorrectly configured to access the "java" and "ant" exes. If you want to know if they are installed correctly, you can simply execute both (from any folder):

 $ java 

or

 $ ant 

and the program must be found.

+2
source share

Two things that may also help:

In the above question, there is one line of command line code that is clearly shown in the docs :

 $ cordova platform add android 

I also forgot about this, and this caused the error mentioned in the question.

In addition, if you, like me, added plugins before realizing this error, you will not be able to fix it, except to delete the entire project and rebuild it.

0
source share

All Articles