Sometime you get un-expected errors, missing plugins etc. A simple way to reset everything to afresh is this:
Delete the app’s
node_modules/
Delete the app’s package-lock file (if present)
package-lock.json
Delete the app’s
platforms/
Delete the app’s
plugins/
Run
npm install
(which will regenerate what you deleted above)
Run
npm run build
(try with and without the –prod flag)
Run
ionic cordova platform add android
Run
ionic cordova platform add ios