I have issues with cordova and ionic. When I start a project only with Cordova I can build and emulate Android.
$ cordova build android && cordova emulate android
But, if I create a Ionic project. When I try build and emulate the console show me this message:
Running command: /home/juanobrach/moonpicker/Ionic/test1/platforms/android/cordova/build
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/juanobrach/moonpicker/Ionic/test1/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/juanobrach/moonpicker/Ionic/test1/platforms/android/cordova/build: 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.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I'm really so confused about it
you need set the enviromental variables
in ubuntu try this this directory is where are your android sdk