I was able to build my apk with --prod tag before firebase latest update but June 2019 onwards it is consistently throwing some error. Tried all the solutions available online but nothing worked.
Now i realize that if i build the APK without --prod tag and with --release then i am able to build it. So my question is that is it mandatory to have --prod tag? If yes then what are the benefits?
I believe the --prod is not mandory although desirable in production situation given for instance environment setup in angular (enableProdMode) and other best practices in separating environment (like firebase configs, one for prod one for uat etc).
Next, --prod will do some additional processing on your code making smaller bundles and some performance improvements, minifying etc. All magic to me, but somehow needed for prod.
So, depends on what you want to use the apk for, but in the end you will probably end up using it anyway.
Thanks for the quick revert Tom. My understanding regarding --prod was the same. But as soon as i use this to build APK, it throws following error:
[21:04:10] ionic-app-script task: "build"
[21:04:10] TypeError: Object prototype may only be an Object or null: undefined
TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at Object.__extends (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/tslib/tslib.js:64:9)
at /Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:115:17
at /Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:314:6
at Object.defineProperty.value (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:3:17)
at Object.<anonymous> (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:9:3)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --prod --target cordova --platform android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.