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 theandroid
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.
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.
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.
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With