Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"cordova platform add android" fails with unexpected error

i am trying to install Phonegap on Ubuntu 13.04, i have installed the Android SDK with all available Packages, but running the following command:

cordova platform add android

fails with an unexpected 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...

I have set the PATH Variables for Android (tools / platform-tools) and java and ant are installed.

Why does this happen? How can i get a more detailed error message?

like image 715
Bastian Seeleib Avatar asked Jul 13 '13 17:07

Bastian Seeleib


2 Answers

have you tried running command with sudo? it could be a permissions issue.

If still not working, try running it using verbose mode i.e. sudo -d cordova...

In case this is due to activity name whitespaces, see comments for this answer.

There is an issue reported in https://issues.apache.org/jira/browse/CB-4198, for which I've sent a pull request to remove whitespaces https://github.com/phonegap/phonegap/pull/39.

like image 88
José Lecaros Avatar answered Oct 24 '22 07:10

José Lecaros


As @José said, the "hello" example doesn't work because spaces are not allowed. Changing it to "HelloWorld" solves the problem.

like image 40
krylovsk Avatar answered Oct 24 '22 08:10

krylovsk