Failed to find 'ANDROID_HOME' environment variable : <p>I am trying to build an ionic-android project and i have android sdk installed. </p>

<p><a href="https://i.stack.imgur.com/Bmoa3.png"><img src="https://i.stack.imgur.com/Bmoa3.png" alt="SDK manager installed packages"></a></p>

<p>The name of my project is myApp.I have successfully added android platform to myApp. But when i tries to build the project</p>

<pre><code>~/myApp$ sudo ionic build android
</code></pre>

<p>result is </p>

<pre><code>Running command: /home/hari/myApp/hooks/after_prepare/010_add_platform_class.js /home/hari/myApp
  add to body class: platform-android
  ERROR building one of the platforms: 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.
You may not have the required environment or OS to build this project
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.
</code></pre>

<p>see the ANDROID_HOME and PATH variable</p>

<pre><code>echo $ANDROID_HOME
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk/tools:/home/hari/Android/Sdk/platform-tools:/usr/local/bin:/opt/gradle/bin
</code></pre>

<p>I have seen almost the same kind of questions on stack overflow, but none works for me. Is there anything wrong with my android-sdk configuration? How can i build this project? </p>
