1

I'm using ionic2. When I run

command ionic cordova run android 

,I get this error:

✖ Running command - failed!
[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
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.

Although I had set android environment variable in ~/.bachrc. When I run command:

echo $ANDROID_HOME in terminal 

,I have output:

/home/shimaa/Android/Sdk

That is what I wrote in ~/.bashrc:

export ANDROID_HOME="/home/shimaa/Android/Sdk"
export PATH=${PATH}:/home/shimaa/Android/Sdk/platform-tools:/Development/android-sdk/tools

can anyone tell me what is the problem and thank you in advance

Al-shimaa Adel
  • 767
  • 1
  • 10
  • 26
  • Didnt you ask this https://stackoverflow.com/questions/45386890/ubuntu-cant-run-ionic-app-on-emulator-because-android-sdk-doesnt-exist ? – Suraj Rao Jul 31 '17 at 08:33

1 Answers1

0

For me I have Android_Home path inside my "Path" as "C:\Users\user\AppData\Local\Android\sdk\build-tools\26.0.0" After setting up the path, restart your system.

Sujay
  • 613
  • 1
  • 5
  • 16
  • I'm using Ubuntu and I don't Know how to set Android home path inside your PAth, is there any link that describe it? – Al-shimaa Adel Jul 31 '17 at 08:27
  • You can refer to this [link](https://stackoverflow.com/questions/26256279/how-to-set-android-home-path-in-ubuntu-please-provide-the-steps). i am working with windows system. I hope it helps you. – Sujay Jul 31 '17 at 08:35