How to set ANDROID_HOME environment variable in ubuntu 16.04

I am facing this error while running the java mobile automation test case with appium

mvn -Dtest=SavedPhotosTest  test -DFILEPATH="sample.apk"

An unknown server-side error occurred while processing the command.
Original error: packageAndLaunchActivityFromManifest failed. Original
error: Could not find aapt Please set the ANDROID_HOME environment
variable with the Android SDK root directory path. (WARNING: The
server did not provide any stacktrace information)

I’ve set the ANDROID_HOME in my .bashrc already

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

appium is also running on the another terminal


IntelliJ IDE –> ideaIC-2017.2.4 Android-studio –>
android-studio-ide-162.4069837-linux appium –> 1.7.1

I’ve already tried the following links:
Could not find aapt with appium server

How to set IntelliJ IDEA Project SDK

I need a quick fix for this issue. Kindly help