Error: Failed to find 'ANDROID_HOME' envir

2019-08-14 04:29发布

When i am running ionic app i am getting android home setting error. Here is my full commands and their output

sudo ionic run android

Running command: /home/manish/do_practice/ionic/hooks/after_prepare/010_add_platform_class.js /home/manish/do_practice/ionic
add to body class: platform-android
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.

Here is my ~/.bashrc file entry

export ANDROID_HOME=/home/manish/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

here is echo commands

echo $ANDROID_HOME
/home/manish/Android/Sdk
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/manish/Android/Sdk/tools:/home/manish/Android/Sdk/platform-tools

3条回答
够拽才男人
2楼-- · 2019-08-14 05:15

try to set tools as well, try following code ,edit this android sdk path to yours,

export ANDROID_HOME=/Users/Mac/Desktop/mac/android-sdk-macosx
PATH=$PATH:$ANDRIOD_HOME/tools
PATH=$PATH:$ANDRIOD_HOME/platform-tools
查看更多
来,给爷笑一个
3楼-- · 2019-08-14 05:18

Please reload your bashrc by using this command:

source ~/.bashrc
查看更多
The star\"
4楼-- · 2019-08-14 05:24

"build-tools" directory is missing in your PATH. Remove both "export" lines from your .bashrc file and copy this:

export PATH=$PATH:/home/manish/Android/Sdk/platform-tools:/home/manish/Android/Sdk/tools:/home/manish/Android/Sdk/build-tools
查看更多
登录 后发表回答