How to add platform android (cordova) on Mac

让人想犯罪 __ 提交于 2019-12-02 13:24:54

问题


i have follow the instructions.phonegab docs and How to add android to cordova platform? PATH error?

my .bash_profile:

export PATH=/usr/local/bin:$PATH
export PATH=$PATH:~/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools
export PATH=${PATH}:~/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:~/Development/adt-bundle-mac-x86_64-20140321/sdk/tools
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"

but still Error while i executing cordova platform add android or ionic platform android:

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.

Any Solutions? thank you


回答1:


Try to run android in command line. if the command is not found, it's mean that the path of android sdk that registered is still wrong




回答2:


AndroidDev PATH

export PATH=${PATH}:~/android-sdk-linux/tools

export PATH=${PATH}:~/android-sdk-linux/platform-tools

You have to manually reload your setting like for Ubuntu I am using this command "$ source ~/.bashrc"




回答3:


Thank you All for your clue of solutions. I try add $HOME because /Development directory in /Home directory and i followed code RVM in my .bash_profile:

`[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"`

The solutions in How to add android to cordova platform? PATH error? i followed symbol ~ for initialize /Development directory in /Home directory, but it's not working. and I try follow code RVM in my .bash_profile use $HOME.

this is my .bash_profile:

 export PATH=${PATH}:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/tools
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"

and then run command source ~/.bash_profile. Solved



来源:https://stackoverflow.com/questions/24951809/how-to-add-platform-android-cordova-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!