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

前端 未结 22 1135
闹比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: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//Library/Android/sdk/"
    export ANDROID_TOOLS="/Users//Library/Android/sdk/tools"
    export ANDROID_PLATFORM_TOOLS="/Users//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
    

提交回复
热议问题