An error occurred while running subprocess cordova. cordova run android --proxy --livereload-port 35729 --dev-logger-port 53703 exited with exit code 1

#1

It was working earlier today but ionic cordova run android will not work on any project. I am getting the same error. ionic serve works perfectly.

EDITED: Downgraded back to ionic 3 and it is working.

ionic-app-scripts build --target cordova --platform android
[16:11:36] ionic-app-scripts 3.1.4
[16:11:36] build dev started …
[16:11:36] clean started …
[16:11:36] clean finished in 13 ms
[16:11:36] copy started …
[16:11:36] deeplinks started …
[16:11:37] deeplinks finished in 125 ms
[16:11:37] transpile started …
[16:11:39] transpile finished in 2.45 s
[16:11:39] preprocess started …
[16:11:39] preprocess finished in less than 1 ms
[16:11:39] webpack started …
[16:11:39] copy finished in 2.88 s
[16:11:44] webpack finished in 5.40 s
[16:11:44] sass started …
[16:11:46] sass finished in 1.13 s
[16:11:46] postprocess started …
[16:11:46] postprocess finished in 9 ms
[16:11:46] lint started …
[16:11:46] build dev finished in 9.36 s
[16:11:48] lint finished in 2.12 s
cordova run android --proxy --livereload-port 35729 --dev-logger-port 53703
Android Studio project detected
The platform “35729” does not appear to have been added to this project.
[ERROR] An error occurred while running subprocess cordova.

When I ran Ionic cordova run android --livereload -cs I got the following.

TypeError: arg.includes is not a function**

at args.length.args.map.arg

(/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/shell.js:130:44)

at Array.map (<anonymous>)

at ShellCommand.bashify

(/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/shell.js:130:29)

at Shell.<anonymous> (/usr/local/lib/node_modules/ionic/lib/shell.js:27:33)

at Generator.next (<anonymous>)

at fulfilled

(/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:104:62)

at <anonymous>**
#2

It was because I had installed ionic 4. What is the difference ?