简体   繁体   中英

Error adding android as a platform Cordova 3.5.0 on Mac OSX 10.9.3

I have been at this for 2 days now. I have added iOS as a platform with no issue. However adding Android as a platform is giving me this error:

"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."

I have added read tonnes of similar issues and added to my path like so:

export ANDROID_HOME=/Users/MYUSERNAME/SDKs/Android_SDK/
export PATH=/Users/MYUSERNAME/SDKs/Android_SDK/platform-tools:/Users/MYUSERNAME/Android_SDK/tools:$PATH

Yet it still throws up the same error. I used echo $PATH to make sure the path had updated and it's all as it should be according to other forums. Any ideas on why this isn't working for me? I'm losing my mind at this point!

Managed to figure it out. When specifying your path through "export PATH=" apparently it matter which one you check first. So what I had was

export PATH=/Users/MYUSERNAME/SDKs/Android_SDK/platform-tools:/Users/MYUSERNAME/Android_SDK/tools

what it should have been was

export PATH=/Users/MYUSERNAME/SDKs/Android_SDK/tools:/Users/MYUSERNAME/Android_SDK/platform-tools

platform is now added and seems to be working fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM