Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating new, first, phonegap Android project on mac returns error: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1

I installed the all the recommended programs from PhoneGap's Getting Started Guide and followed the various steps.

I created the .bash_profile file and it looks like this:

export PATH=${PATH}:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools

The Development folder is located on my desktop. Upon navigating in terminal to my bin directory and creating a new PhoneGap project, i did like so:

./create /Users/joey/PhoneGapExample nl.symvoli.phonegapExample PhoneGapDemo

I get the following error:

An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...

I searched around what might cause this problem and everything seems to be pointing to value of the $PATH environment variable. When i ran echo $PATH in my terminal, it returns this:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools

Any help would be much appreciated.

I'm on a Mac, running Mac OSX 10.8.3

like image 252
Joey Avatar asked Dec 01 '25 11:12

Joey


2 Answers

just command this in terminal/console

export PATH=${PATH}:"/Applications/Android Studio.app/sdk/tools":"/Applications/Android Studio.app/sdk/platform-tools"

check with echo $PATH and you show this

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Applications/Android Studio.app/sdk/tools:/Applications/Android Studio.app/sdk/platform-tools
like image 196
xrockstar Avatar answered Dec 02 '25 23:12

xrockstar


have you executed the ./create script with sudo? if you run the script with sudo:

sudo ./create .....

you have another environment setted.

otherwise you have to export ANDROID_BIN variable

export ANDROID_BIN=/<your_android_sdk>/tools/android
like image 37
Raffaello Avatar answered Dec 02 '25 23:12

Raffaello