When I run ionic build android command in root of ionic project, I am getting this error:
FAILURE: Build failed with an exception.
In my case, the Enviroument Variable ANDROID_HOME was pointed to wrong (old) directory. I reallocated to correct one. In my case
ANDROID_HOME=F:\Program Files (x86)\Android\android-sdk