0

I tried adding Android as a platform using the command $ ionic platform add Android , when I tried emulation it shows me this error , how to deal with this ? as I am using mac for the first time I have no clue how to deal with it in mac OS .

     ERROR: Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
        Error: /Users/ansingh/myApp/platforms/android/cordova/run: Command failed with exit code 2
            at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
            at ChildProcess.emit (events.js:98:17)
            at maybeClose

 (child_process.js:756:16)
        at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Anky
  • 270
  • 1
  • 5
  • 20
  • 1
    [http://stackoverflow.com/questions/19986214/setting-android-home-enviromental-variable-on-mac-os-x][1] – onner Aug 17 '15 at 07:29

1 Answers1

0

I have gave my MAC path. Hope this will be useful. Use your android directory instead of mine.

Add these things in .bash_profile in your user directory If you can't find the file, please create one

export ANT_HOME="/usr/share/ant"
export PATH=$PATH:$ANT_HOME/bin
export GRADLE_HOME="/usr/share/gradle-2.4"
export PATH=$PATH:$GRADLE_HOME/bin

export ANDROID_HOME=/Users/imran_nazeer/Documents/Installbles/android-sdks
export PATH=$PATH:/Users/imran_nazeer/Documents/Installbles/android-sdks/tools:/Users/imran_nazeer/Documents/Installbles/android-sdks/platform-tools:$PATH
Mohammed Imran N
  • 1,279
  • 1
  • 11
  • 26