1

I am new to Ubuntu and trying to create an ionic project. When I try to build my project with:

ionic build android

It says

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 googled about it and found that I need to set the environment variable that refers the sdk path. Some say to set it in the .profile file and some say to set it in .zshrc file (I am using zsh as my shell). But neither works for me.

Can anyone tell me what an environment variable is and how I would set it? I have only basic knowledge in Ubuntu. I am using Ubuntu 14.04 LTS.

8
  • 1
    How did you "set" the variable exactly?
    – kos
    Mar 9, 2016 at 9:47
  • Now there is nothing set. i deleted everything to start fresh. Mar 9, 2016 at 9:48
  • can you explain how should i set it? Mar 9, 2016 at 9:49
  • I meant how did you try to set it when it didn't work exaclty? ANDROID_HOME=/path/to/sdk or export ANDROID_HOME=/path/to/sdk?
    – kos
    Mar 9, 2016 at 9:52
  • 1
    And where are you running ionic build android from? Are you sure the path is correct? export ANDROID_HOME='/path/to/sdk' in ~/.zshrc should have worked for all interactive shells (in the console, in a terminal etc).
    – kos
    Mar 9, 2016 at 9:56

0

You must log in to answer this question.

Browse other questions tagged .