Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add android to cordova platform? PATH error?

I am trying to add android as a cordova platform so that I can build apps with phonegap. When I tried to add android thus:

$ cordova platform add android

I received this error message:

[Error: The command android failed. Make sure you have the latest Android SDK installed, and the android command (inside the tools/ folder) added to your path. Output: /bin/sh: android: command not found ]

I do have the latest Android SDK installed, so I suppose I need to add android to my path. I've googled on how to do that, and searched this forum, but I have little knowledge of command line use and I don't understand the answers.

If someone could provide very simple steps to add android to my path, I would be most grateful.

like image 505
Jimmy Verner Avatar asked Jul 31 '13 16:07

Jimmy Verner


People also ask

Do I need Android studio for Cordova?

Cordova-Android requires the Android SDK, which can be installed on either macOS, Linux, or Windows. For the base system requirements, see the Android Studio's System Requirements.


3 Answers

There's step-by-step instructions on the PhoneGap Doc's. Check it out here, and then go to Step 3B. I linked to the 2.8 version of PhoneGap since from a quick look it doesn't seem to explain how to set up PATH on the 3.0 version docs.

like image 151
Drew B. Avatar answered Dec 09 '22 09:12

Drew B.


I just figured this out. You need to use the path where your android tools are actually installed. Mine happen to be in the default location (and I'm using x64) so, /Applications/adtbundle name/

Just see for yourself!

see for yourself

like image 33
user43633 Avatar answered Dec 09 '22 09:12

user43633


I was running into a rather silly problem here. The path that I cut and pasted had the adt-bundle listed as "adt-bundle" (as one might expect :)) but I never changed the name of the directory as it was downloaded, which was "adt-bundle-mac-x86_64-20131030."

Additionally, the path ($PATH) that I cut and pasted into my .bash_profile began with "/Development" when it should have begun with "~/Development" since the Development directory was in my home directory.

I don't know if anyone else might find this info useful, but it was a relief to me when I realized that I just needed to correct the paths I'd specified in .bash_profile.

like image 34
flyingace Avatar answered Dec 09 '22 11:12

flyingace