title: Ionic can't run ionic platform android
body: <p>I am starting to follow <a href="http://ionicframework.com/docs/guide/installation.html" rel="noreferrer">this</a> demo for learning the ionic framework. </p>
  
  <p>I made it to the point where it suggests that I type in <code>ionic platform android</code>. When I type that, I get this error:</p>
  
  <pre><code>C02FF724DF91:todo jcorser$ ionic platform android
  Creating android project...
  
  /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:126
                      throw e;
                            ^
  Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
      at /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:158:19
      at _fulfilled (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:798:54)
      at self.promiseDispatch.done (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:827:30)
      at Promise.promise.promiseDispatch (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:760:13)
      at /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:821:14
      at flush (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:108:17)
      at process._tickCallback (node.js:419:13)
      at Function.Module.runMain (module.js:499:11)
      at startup (node.js:119:16)
      at node.js:906:3
  Error: /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/create: Command failed with exit code 8
      at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
      at ChildProcess.emit (events.js:98:17)
      at maybeClose (child_process.js:755:16)
      at Process.ChildProcess._handle.onexit (child_process.js:822:5)
  </code></pre>
  
  <p>I am on Mac OSX. I have developed two android apps before using Android Studio. I also followed the suggestion for OSX on the manual <code>$ export JAVA_HOME=$(/usr/libexec/java_home)</code> but this did not fix the problem.</p>