Hi all !
I am trying to build my project with --prod option and it fails:
ionic cordova build android --prod --release
[INFO] Running app-scripts build: --prod --platform android --target cordova
[14:49:56] build prod started ...
[14:49:56] clean started ...
[14:49:56] clean finished in 47 ms
[14:49:56] copy started ...
[14:49:56] ngc started ...
TypeError: Cannot read property 'codeGen' of undefined
I found tw other topics about the same issue but no solution seems to have been found. I am building the app on Ubuntu 16.04. This is the output of ionic info:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 1.3.12
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 26.0.2
Node : v8.3.0
npm : 5.3.0
OS : Linux 4.10
And package.json
{
"name": "XXXX",
"author": "XXXX",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic/storage": "2.0.0",
"cordova-android": "^6.2.3",
"cordova-plugin-device": "1.1.4",
"cordova-plugin-network-information": "^1.3.3",
"cordova-plugin-splashscreen": "~4.0.1",
"cordova-plugin-statusbar": "2.2.1",
"cordova-plugin-whitelist": "1.3.1",
"cordova-sqlite-storage": "^2.0.4",
"ionic-angular": "^3.6.0",
"ionic-native": "2.2.11",
"ionic-plugin-keyboard": "~2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26"
},
"devDependencies": {
"@ionic/app-scripts": "^1.3.7",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {}
},
"platforms": [
"android"
]
}
}
If I build without the --prod option, it works
Thanks for any help.