Sindre
Sindre

Reputation: 3940

Problems making Android project with Phonegap CLI

When I use the following command to add a Android project:

$ cordova projects add android

I get the following error:

An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY

&/dev/null exited with 1

I am on a mac, have installed the Android SDK, added tools and platform-tools of the Android SDK to path. I have also installed/updated to the latest revs. using the android installer.

Is there anyone who have experienced similar problems making an Android project with the new Phonegap CLI and know what is wrong / How do tackle it?

Update:

I managed to find out some more. Seems like i have a problem in line 691 in the build.xml file of the android-sdk/tools/ant/ folder:

proguardFile="${out.absolute.dir}/proguard.txt">

Upvotes: 3

Views: 884

Answers (2)

Claude COULOMBE
Claude COULOMBE

Reputation: 3738

Attention not to have any special characters or space in the name of your Android project. I've got a similar problem with an dash or hyphen (-) in the name of my project. So, just remove the inappropriate character.

Upvotes: 2

Carlos Duque Yemail
Carlos Duque Yemail

Reputation: 196

(Because I can't comment, i'm going to give you my answer). I had the same problem I found out the error was when I created the project, I followed the instructions on the phonegap documentation (which is pretty bad) where it says the following:

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

I did almost the same, but I found out there was an error with the "Hello World" because of the space it uses. Then You should change it to something like this (which worked for me)

$ cordova create HelloWorld com.example.hello helloWorld

Hope this works for you.

Upvotes: 3

Related Questions