Error: ANDROID_HOME is not set and “android” command not in your PATH. You must fulfill at least one of these conditions

后端 未结 6 1869
野的像风
野的像风 2020-12-31 05:01

I am MAC OS X Yosemite I have done all the export tutorial to set the android_home but non of it working for me

6条回答
  •  星月不相逢
    2020-12-31 06:01

    I had the same problem. Luckily it is easily fixable. Just follow the next few steps (Command-line from terminal).

    1. Open the bash_profile file using command line arguments with -

      vi ~/.bash_profile

    OR

    It is possible to open bash_profile in TextEdit and make changes there. Use the following command to do this -

    open -a "TextEdit" .bash_profile

    1. Check if ANDROID_HOME has been set in this file. If it has been already set, delete it (probably wrong). Also check if PATH in this file has any reference to tools or platform-tools (of the android sdk). You'd be better off deleting these before you start typing the following commands.

    2. Set ANDROID_HOME correctly using the following command export ANDROID_HOME=/Users/adarsh/android-sdk-macosx

    ^this is my command because I installed it in that location. Please replace "adarsh" with your username and "android-sdk-manager" with the name of your android sdk folder that you downloaded. Do not copy-paste this command.

    For example, if your username is "John" and you the android sdk folder you downloaded and installed is in "Downloads" and you changed your folder name to "sdk", then your command would be -

    export ANDROID_HOME=/Users/John/Downloads/sdk

    1. Set PATH with the following command

      export PATH=$ANDROID_HOME/tools:$PATH

    2. Refresh your bash_profile to set all the changes we just made by typing the command

      source ~/.bash_profile

    You should be good to go now and begin developing with ionic!Hope this helps. Cheers.

提交回复
热议问题