Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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">
like image 395
Sindre Avatar asked May 16 '26 05:05

Sindre


2 Answers

(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.

like image 100
Carlos Duque Yemail Avatar answered May 17 '26 18:05

Carlos Duque Yemail


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.

like image 36
Claude COULOMBE Avatar answered May 17 '26 19:05

Claude COULOMBE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!