Ionic android build Error - Failed to find 'ANDROID_HOME' environment variable

前端 未结 12 1478
庸人自扰
庸人自扰 2020-12-23 19:41

I am trying to build android for ionic in linux but its showing me an error like this

     [Error: Failed to find \'ANDROID_HOME\' environment variable. 
           


        
12条回答
  •  生来不讨喜
    2020-12-23 19:45

    Android Home should be the root folder of SDK.

    export ANDROID_HOME="$HOME/android-sdk-linux"
    

    EDIT: Open terminal and type these commands. (yes, on a ternimal , not in bashrc file)

    export ANDROID_HOME=~/android-sdk-macosx
    PATH=$PATH:$ANDROID_HOME/tools
    PATH=$PATH:$ANDROID_HOME/platform-tools    
    

    and then in the same terminal just type android. If configured you would be able to use build commands from this terminal. (it's a temporary solution)

提交回复
热议问题