Cannot emulate or build Android


#1

I am on Ubuntu 14.04 LTS, I installed Android Studio. When typing sudo ionic build android I get this error:

Running command: /home/fathi/ionic/favorlinks/hooks/after_prepare/010_add_platform_class.js /home/fathi/ionic/favorlinks
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.

I configured ~/.bashrc file with environnment variables like this:

export ANDROID_HOME=/home/fathi/Android/Sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 

When I type android in the terminal, it opens the Android SDK Manager, but I still not able to emulate or build.
Next, I installed all Android SDK Tools and Android SDK Build Tools and it still not working!

Now, I’m desespered cause, I can’t figure out how to make it works.