PhoneGap/Cordova Android Development PhoneGap/Cordova Android Development android android

PhoneGap/Cordova Android Development


It's possible that the Android tools binaries are not in your path.

According to the PhoneGap docs (http://docs.phonegap.com/en/2.9.0/guide_getting-started_android_index.md.html), you need to include the Android SDK's tools and platform-tools in your PATH environment variable.

export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools

where Development is the path you installed your SDK.


Run the "android" command from your adt\sdk\tools folder and install the latest Tools and SDK. Also make sure your PATH has the right variables.

For this you will need ANT to be installed , a JAVA JDK and an Android SDK installed

JAVA_HOME (C:\Program Files\Java\jdk)

ANT_HOME ({ant location}\apache\apache-ant)

ANDROID_HOME ({android sdk location}\android-sdk)

Add these to your PATH variable like %ANT_HOME%/bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin

Close and re-open your cmd and run your command again.


I'm running Ubuntu 12.04 and was having the same problem as you until a few minutes ago.

The two things I've noted that I had missed during installation:

  1. The Android version should be 19 and you should be able to type 'android' at the console and see some output or see a window pop-up. Make sure that you add the path to the folder where android.jar is located to your PATH variable, and set ANDROID_HOME to that same path as well. Typically, you would do this in your .bashrc file or in /etc/environment If you edit either of these files, you'll need to either 'source ~/.bashrc' or reopen your terminal to force it to reload the file. Type 'android' to make sure its working.

  2. I observed that the cordova setup script was attempting to write files into a subdirectory 'add-ons' of the Android SDK. That directory does not exist in the Android 19 distribution itself. Consequently, I created it manually and made it writeable by my user account.

ex: Android distribution path:

/opt/android/

The path that its trying to write to:

/opt/android/sdk/add-ons

Once I had done that I was able to get past the problem you've noted above.