Add $ANDROID_HOME to linux PATH
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.
Adding android sdk to the PATH
Open Terminal and run [c]echo $ANDROID_HOME[/c] to view the current Android Home Path if any.
If it returns a directory make sure it is infact the correct android sdk directory.
If it does not return anything then open terminal and type
or if you want graphical editor then
And add these
export ANDROID_HOME='/home/<user_name>/Android/Sdk' <Path to android SDK> export PATH=$PATH:$ANDROID_HOME/bin export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools
*** Make sure the change the ANDROID_HOME to the correct directory*
Then run this command for the changes to take effect
To check if it worked run
This should output the android sdk directory.
If you want to use cordova then you may have to add Gradle to the PATH too. If you have Android Studio installed then gradle will also be installed. You can use that version or you can install it separately.
Simply add this line to add Grade to the PATH
Change the <installed-gradle-version> to the correct installed version