Phonegap Android Mac - ANT Issue

2019-08-24 03:54发布

问题:

I want to install phonegap in my Mac, I've already installed and "platform add ios" succesfuly but have some problems with "platform add android"

It says "Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path."

The SDK is there (and working fine through eclipse)

I found in other posts that is a "PATH" issue so I created ".bash_profile" with the correct PATH to "tools" and "platform-tools" and then it said that couln't find "ant"

I tried to install it by Brew (like I read in another post) but can't execute Brew (it says command not found)

I tried to install MacPort but when i write in terminal "port" it says "command not found"!

I tried downloading the Ant Bins and copying into the usr/shared/Ant folder and then adding to the PATH... but now I got back to "The command android failed. Make sure you have..."

I'm so confused... please help!

my echo $PATH right now is: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/lioncio/Desktop/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/lioncio/Desktop/adt-bundle-mac-x86_64-20140702/sdk/tools:/Users/lioncio/Desktop/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/lioncio/Desktop/adt-bundle-mac-x86_64-20140702/sdk/tools:/usr/share/ant

thanks!

回答1:

I've found a kind of solution (not really a good solution but...)

The problem was that when I installed Brew the internet connection disconnected and brew stood half installed. So...

I tried to install MacPorts (as I said) and it seems that after that Brew uninstalled because of this (I don't know why) and then I could install it again...

Hope it helps someone