I downgraded the ionic to v2.2.3 it worked like a charm. Thanks.
Sigh, this is of course not a solution to the problem it self. Could you please add to the Github issue linked above that you also encountered this problem so it can be prioritized by the number of people affected?
I have added a comment to the above GitHub link. Hope to find a fix soon. Thanks. 
I’ve upgraded ionic to version 3.1.1 and it worked 
I am now on ionic 3.19.0 and I am getting the same error when I try to do a Android build. I can serve it with ionic serve --browser chrome, but when I do either ADD platform or BUILD for android, I get this error. I am not sure where to start, so I am posting here and hoping someone can lead me to a direction to get this resolved so I can build for Android.
Here is my Ionic info
cli packages:
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.7
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.1.2
npm : 5.0.3
OS : Windows 8.1
Environment Variables:
ANDROID_HOME : --- is set, just not showing my path here ----
Misc:
backend : pro