Error: Failed to find 'ANDROID_HOME' environment variable

whenever i try to deploy i got the following error:

> 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.

Have you Android SDK installed in your machine ?
if no so use Android Studio to install it then add ANDROID_HOME on your PATH variable

open terminal

vim /etc/profile.d/java.sh

add

ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools

My Android SDK is installed in my home that why i used $HOME vaiable

Can you please little elaborate ???
i have typed vim /etc/profile.d/java.sh
what i got
vim is not recognized as internal or external command

instead vim use vi

vi /etc/profile.d/java.sh

it’s not working
but i have fixed by re-installing android-sdk using android studio.