I am learning how to use Ionic by doing a test application but I have had this problem for two days. I have looked for possible solutions but none has worked for me.
The way i solved this problem is as below:
1) npm uninstall cordova ionic
2) npm install -g cordova@7.0.0 ionic@3.19.0
3) cordova platform rm android
4) cordova platform add android