Exit code 1 and 8. Ionic framework and cordova

So I've been getting the exit codes 1 and 8 when doing "ionic run android". Thing is, this was working perfectly fine a few days ago and now it is starting to throw this error each time I try to run my app on my Nexus 5. I had previously tried the AndroidInAppBilling plugin with no luck (anyone get inApp Billing working yet?) and ended up removing it thinking it was causing the error.

Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\xampp\htdocs\testapp\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\xampp\htdocs\testapp\platforms\android\cordova\run.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Rudy\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess.handle.onexit (childprocess.js:820:5)
ERROR: Unable to run app on platform android. Please see console for more info.
Exiting.

As for Ant, I did a version check: Apache Ant(TM) version 1.9.4 compiled on April 29 2014

Java version info: java version "1.8.0_11" Java(TM) SE Runtime Environment (build 1.8.0_11-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

PATH also has the Android sdk and Ant values: C:\Ant\apache-ant-1.9.4\bin;C:\AndroidSDK\sdk\tools;C:\AndroidSDK\sdk\platform-tools

Forgot to mention I also tired "cordova platform rm android" and then added it again.

Anyone have any ideas?

Ok so I was able to get this to work again. In my project directory, I did a command line "android" to launch the sdk manager. I went ahead and updated the sdk versions that were showing an update was available. After doing that, I tried both the run and build commands and both were successful. I also want to mention I had the Genymotion emulator running in the background while doing this so I'm not sure if that had anything to do with it but its worth a shot in case someone else is stuck with the same error.

hi friend i have same problem with you (i am using windows 8), the solution for whis problem is you should fix your variable environtment , like this i have User Variables

ANDROID_HOME

D:\adt-bundle-windows-x86_64-20140702\sdk

ANT_HOME

C:\Program Files (x86)\WinAnt

JAVA_HOME

C:\Program Files\Java\jdk1.8.0_31

PATH

%SystemRoot%\system32;%SystemRoot%;
%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\Program 
Files\Java\jdk1.8.0_31\bin;
D:\Master\ionic\apache-ant-1.9.4-bin\apache-ant-1.9.4\bin;
C:\Users\Mutik Hidayati\AppData\Roaming\npm;
C:\Program Files\nodejs;
D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;
D:\adt-bundle-windows-x86_64-20140702\sdk\tools

System variables

Path

`%C_EM64T_REDIST11%bin\Intel64;
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;`C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;`%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;`
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;`
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;`
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;`
C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;
C:\Program Files (x86)\Git\bin;
D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;
D:\adt-bundle-windows-x86_64-20140702\sdk\tools

then to build open the directory ..\platforms\android\cordova then run build

its work for me