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

前端 未结 22 793
闹比i
闹比i 2020-11-22 16:16

I\'m trying to install PhoneGap and I\'m getting the following error:

Error: ANDROID_HOME is not set and "android" command not in your PATH. Yo

22条回答
  •  伪装坚强ぢ
    2020-11-22 16:44

    In Linux,

    edit .bashrc file and add the ANDROID_HOME and PATH variable,

    export ANDROID_HOME=/usr/local/android-sdk-linux/
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
    

    After saving .bashrc file, run

    source ~/.bashrc
    

    then in type

    android in a terminal

    if it will run, ANDROID_HOME and PATH is set,

    if you get this message,

    bash: /src/android-sdk/tools/android: Permission denied
    

    then run

    sudo chmod a+x /usr/local/android-sdk-linux/tools/android
    

    otherwise you will get same error message

    Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
    

    NB: Use your android sdk installation path instead of /usr/local/android-sdk-linux/

提交回复
热议问题