Build - -release succeed but build - -prod fail. Why?

Hi all,

I want to publish my app, but the startup time is too long so I want to build the app with --prod in order to have shorter startup time.
The problem is that while the following command succeed:
ionic cordova build android --release
the following command fail:
ionic cordova build android --prod
and also the following command fail:
ionic cordova build android --release --prod

The error is:

Error: Metadata version mismatch for module workspace/node_modules/angularfire2/index.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (workspace\node_modules@angular\compiler\bundles\compiler.umd.js:24474:34)
at StaticSymbolResolver._createSymbolsOf (workspace\node_modules@angular\compiler\bundles\compiler.umd.js:24260:46)
at StaticSymbolResolver.getSymbolsOf (workspace\node_modules@angular\compiler\bundles\compiler.umd.js:24241:14)
at workspace\node_modules@angular\compiler\bundles\compiler.umd.js:23023:30
at Array.forEach (native)
at extractProgramSymbols (workspace\node_modules@angular\compiler\bundles\compiler.umd.js:23022:79)
at AotCompiler.compileAll (workspace\node_modules@angular\compiler\bundles\compiler.umd.js:22720:47)
at CodeGenerator.codegen (workspace\node_modules@angular\compiler-cli\src\codegen.js:30:14)
at Function.NgTools_InternalApi_NG_2.codeGen (workspace\node_modules@angular\compiler-cli\src\ngtools_api.js:61:30)
at workspace\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:182:73

I tried all the solutions for this error from here but nothing help.

ionic info:

[WARN] Detected locally installed Ionic CLI, but it’s too old–using global CLI.

cli packages: (myWorkspace\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.4.2

System:

Android SDK Tools : 26.0.2
Node              : v6.9.1
npm               : 3.10.8
OS                : Windows 7

Environment Variables:

ANDROID_HOME : myWorkspace\AppData\Local\Android\sdk

Misc:

backend : legacy

Any help will be appreciated!!!

i am also facing same issue

Hi frd,
Same Error has occurred.but i use only release.may be working,and you refer given link.

Hi frd,
Thank you for supporting me