我在我的项目中使用AES256离子插件。 (https://ionicframework.com/docs/native/aes256/)
当我尝试运行:ionic cordova build android
时,可以运行,但是当我尝试运行:ionic cordova build android --prod
时,则抛出以下错误:
$ ionic cordova build android --prod --release
> ionic-app-scripts build --prod --target cordova --platform android
[16:00:06] ionic-app-scripts 1.3.12
[16:00:06] build prod started ...
[16:00:06] clean started ...
[16:00:06] clean finished in 10 ms
[16:00:06] copy started ...
[16:00:06] ngc started ...
[16:00:12] ionic-app-script task: "build"
[16:00:12] Error: Metadata version mismatch for module
C:/workspace/app/node_modules/@ionic-native/aes-256/index.d.ts, found version 4, expected 3
Error: Metadata version mismatch for module C:/workspace/app/node_modules/@ionic-native/aes-256/index.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:24474:34)
at StaticSymbolResolver._createSymbolsOf (C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:24260:46)
at StaticSymbolResolver.getSymbolsOf (C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:14)
at C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:23023:30
at Array.forEach (<anonymous>)
at extractProgramSymbols (C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:23022:79)
at AotCompiler.compileAll (C:\workspace\app\node_modules\@angular\compiler\bundles\compiler.umd.js:22720:47)
at CodeGenerator.codegen (C:\workspace\app\node_modules\@angular\compiler-cli\src\codegen.js:30:14)
at Function.NgTools_InternalApi_NG_2.codeGen (C:\workspace\app\node_modules\@angular\compiler-cli\src\ngtools_api.js:61:30)
at Object.doCodegen (C:\workspace\app\node_modules\@ionic\app-scripts\dist\aot\codegen.js:6:51)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
我的ionic info
:
ionic (Ionic CLI) : 4.0.5
Ionic Framework : ionic-angular 3.5.0
@ionic/app-scripts : 1.3.12
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.0.0
System:
Android SDK Tools : 26.1.1
NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10
Environment:
ANDROID_HOME : C:\Users\tm\AppData\Local\Android\android-sdk
在config.xml中,我有:<plugin name="cordova-plugin-aes256-encryption" spec="1.1.0" />
在package.json中,我有:
"dependencies": {
"@angular/animations": "4.1.3",
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3",
"@angular/http": "4.1.3",
"@angular/platform-browser": "4.1.3",
"@angular/platform-browser-dynamic": "4.1.3",
"@ionic-native/aes-256": "^4.18.0",
"@ionic-native/background-mode": "^4.6.0",
"@ionic-native/base64": "^4.5.3",
"@ionic-native/core": "3.12.1",
"@ionic-native/device": "^4.7.0",
"@ionic-native/file": "^4.5.2",
"@ionic-native/file-opener": "^4.5.2",
"@ionic-native/fingerprint-aio": "^4.17.0",
"@ionic-native/network": "^4.5.2",
"@ionic-native/secure-storage": "^4.17.0",
"@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "^3.12.1",
"ionic-angular": "3.5.0", ....