Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova 2.1.0 (PhoneGap) create script for Android says "Project already exists" or "An error occurred. Deleting project"

I am trying to create an Android project on Windows using Cordova 2.2.0 (PhoneGap). According to this blog post this command should work -

create <project_folder_path> <package_name> <project_name> 

But I am getting a message "Project already exists!". I have used the same PC to create, package and submit an Android app so I know I have Java, Javac, Ant, Android e.t.c. installed.

I have also tried this on a Mac with Cordova 2.1.0 and there I get the message "An error occurred. Deleting project.."

Could you please suggest what might be the cause of this error and a possible fix?

Thanks.

UPDATE

This problem seems to be fixed in Cordova 2.2.0 but I haven't found a workaround for 2.1.0

like image 485
Peter Avatar asked Nov 20 '12 14:11

Peter


2 Answers

This drove me up the wall. Solution. Do not create the folder for the project. It will create one for you.

create <project_folder_path> <package_name> <project_name> 

When specifying <project_folder_path>, do NOT first create the folder on your HD.

like image 68
skymook Avatar answered Oct 20 '22 06:10

skymook


To be clear, your target project path should be to be where you want the project to be created and then the last directory will be what you want to be created. For example:

./create ./test2 com.mytest MyTest 

In this case you want to create a project in the current directory in a new folder called "test2" and this folder has not been created yet (it will be created when this is run).

UPDATE: If you are using a newer verison of the Cordova Edge or greater, i highly recommend using the Cordova CLI Utility here: http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-Line%20Interface

like image 25
ezekielDFM Avatar answered Oct 20 '22 08:10

ezekielDFM