[ERROR] An error occurred while running subprocess cordova

I had the same problem and solved it as follows:

  • First I deleted folder platforms (you can also move it to another place).
  • Executed ionic cordova platform add android.
  • After this ionic cordova build android worked again.