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

前端 未结 12 1455
庸人自扰
庸人自扰 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:48

    You only have to edit your profile file like this:

    sudo su
    vim ~/.profile
    

    and put this at the end of the file:

    export ANDROID_HOME=/home/(user name)/Android/Sdk
    export PATH=$PATH:/tools
    export PATH=$PATH:/platform-tools
    

    Save and close the file and do:

    cd ~
    source .profile
    

    now if you do:

    echo $ANDROID_HOME
    

    it should show you something like this:

    /home/(user name)/Android/Sdk
    

提交回复
热议问题