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

前端 未结 22 797
闹比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:45

    If nothing else works, make sure that you have correct permissions and ownership set up during building. A quick fix can be:

    sudo chown -R <you>:<your_group> *
    sudo chmod -R 755 *
    
    0 讨论(0)
  • 2020-11-22 16:46

    This is what I just tried to make it work. I was in:

    os x Yosemite version 10.10.2
    cordova version 4.2.0
    android studio 1.0.1
    Java SE Development Kit 7

    set path:

    # on ~/.zshrc file (open a text editor)
    export ANDROID_HOME="/Users/<user>/Library/Android/sdk/"
    export ANDROID_TOOLS="/Users/<user>/Library/Android/sdk/tools"
    export ANDROID_PLATFORM_TOOLS="/Users/<user>/Library/Android/sdk/platform-tools"
    PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
    

    reopen terminal

    install "android-19" from android SDK manager

    $ android
    # pick "SDK Platform Android 4.4.2, API 19"
    

    and then go to a Cordova-based project directory

    $ ionic platform add android
    
    0 讨论(0)
  • 2020-11-22 16:46

    I also faced this same issue, I got a solution with this.

    I did the following steps :

    1. Open system properties
    2. Environment variables
    3. create a new system variable
    4. name: ANDROID_HOME
    5. value: copy your SDK path( Ex: my SDK path E:\SoftWares\Android-SDK)

    close your current cmd, and restart it run flutter doctor

    this should work on windows

    0 讨论(0)
  • 2020-11-22 16:47
    1. Go to system properties.
    2. Click change setting.
    3. Click advance tab.
    4. Click Environment Variables button.
    5. In system variables area click new button.
    6. Set ANDROID_HOME in the Variable name field.
    7. Set C:\Program Files (x86)\Android\android-sdk in the Variable value field.
    8. Click ok button.
    9. Double click Path variable in the list.
    10. Click new button.
    11. Past C:\Program Files (x86)\Android\android-sdk\platform-tools in the filed.
    12. Click new button again.
    13. Past C:\Program Files (x86)\Android\android-sdk\tools in the field.
    14. Press enter 3 times.

    That's all you need to do.

    0 讨论(0)
提交回复
热议问题