cordova add platform android unexpected error

I ran into a strange problem with cordova. When running cordova platform add android I got this error:

[Error: An error occured during creation of android sub-project. An unexpected error occurred: “$ANDROID_BIN” create project –target $TARGET –path “$PROJECT_PATH” –package $PACKAGE –activity $ACTIVITY >&/dev/null exited with 1
Deleting project…]

Turned out, the problem was a space in the name of my app. So I restarted the app and instead of calling it Find My Car I called it FindMyCar and then it worked. Strange but true.

3 thoughts on “cordova add platform android unexpected error”

  1. Thank goodness you posted this! Like the other commenters, I was running into a bunch of walls trying to deconstruct this error. It was as simple as omitting spaces from the application name*. A+mazing! Thanks so much!

    * In case the random troll is wondering, white spaces in the application name causes this error to occur, even if the application name was given in quotes.

Leave a Reply

Your email address will not be published. Required fields are marked *