I tried several answers to the error below found right here in the OS but none solved the problem. When you run the command sudo ionic build android
the following message is returned
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Detected 'android' command at /opt/android-studio/bin but no 'tools' directory found near.
Try reinstall Android SDK or update your PATH to include path to valid SDK directory.
ANDROID_HOME and PATH environment variables appear to be properly configured
leonardo@antunesleo:~/projects/devcoffee/coffee-force$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/leonardo/Android/Sdk/tools:/home/leonardo/Android/Sdk/platform-tools
leonardo@antunesleo:~/projects/devcoffee/coffee-force$ echo $ANDROID_HOME
/home/leonardo/Android/Sdk
My Sdk is in the directory below.
/home/leonardo/Android/Sdk
The tools and platform-tools directory is within Sdk, as expected.
leonardo@antunesleo:~/Android/Sdk$ ls
add-ons build-tools extras licenses Link para SDK Readme.txt platforms platform-tools SDK Readme.txt sources tools
Does anyone have an idea of what might be happening?