I would like assitance with this error if anyone has seen it before.
I am trying to run ionic cordova build android --prod and its giving me this error
[13:55:15] build prod started ...
[13:55:16] clean started ...
[13:55:16] clean finished in 10 ms
[13:55:16] copy started ...
[13:55:17] deeplinks started ...
[13:55:18] deeplinks finished in 300 ms
[13:55:18] ngc started ...
TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at Object.__extends (C:\mydir\node_modules\tslib\tslib.js:64:9)
at C:\MobileApps2019\MUFSASFINAL\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:115:17
at C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:314:6
at Object.defineProperty.value (C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:3:17)
at Object.<anonymous> (C:\mydir\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:9:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, (and 17 other plugins)
Utility:
cordova-res : 0.6.0
native-run : not installed
System:
Android SDK Tools : 26.1.1 (C:\Users\User\AppData\Local\Android\Sdk)
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
but I also run with command: ionic cordova build android --prod --release – -- --keystore=filename.keystore --alias=myalias .
But when I run without --prod already ok.
Open the packages.json of your main project and change the following versions of dependencies:
"@angular/*"
"@ionic-native/*"
"rxjs"
Also, replace the "scripts" part.
Delete your node_modules folder.
Delete your platform android folder (the entire platform folder or just android folder).
Run npm install
Add platform android
ionic cordova platform add android
Build your app again
ionic cordova build android --prod
After follow these steps, I could build my app again.
Obs.: It’s possible you got some issues related to plugins between these steps. In this case, you might need re-install the plugin(s). Do it and keep those steps in mind. Try to remove and re-add android after re-install the plugins.
I have faced the same issue, got npm audit fix suggestion from npm cmd prompt, done that too but issue not solved, then I removed node-modules, then npm i, this time i haven’t run npm audit fix, then I again run ionic cordova build android --prod
Run successfully