1、ionic cordova build android –release –prod 错误提示:/node_modules/@ionic-native/core/decorators.d.ts found version 4, expected 3,
问题原因:
库不匹配版本
解决方法(方法不一定适用所有)
在我的项目中 把所有开头的软件包”@ionic-native/…“的版本去掉^开头。
开始是
"@ionic-native/app-version": "^4.0.0",
"@ionic-native/core": "^4.0.0",
"@ionic-native/file": "^4.0.0",
"@ionic-native/file-opener": "^4.0.0",
"@ionic-native/file-transfer": "^4.0.0",
"@ionic-native/image-picker": "^4.0.0",
"@ionic-native/is-debug": "^4.1.0",
"@ionic-native/media": "^4.0.0",
"@ionic-native/media-capture": "^4.0.0",
"@ionic-native/network": "^4.0.0",
"@ionic-native/screen-orientation": "^4.0.0",
"@ionic-native/splash-screen": "^4.0.0",
"@ionic-native/status-bar": "^4.0.0",
"@ionic-native/streaming-media": "^4.0.0",
"@ionic-native/video-player": "^4.0.0",
"@ionic/storage": "^2.0.1",
修改后更新
"@ionic-native/app-version": "4.0.0",
"@ionic-native/core": "4.0.0",
"@ionic-native/file": "4.0.0",
"@ionic-native/file-opener": "4.0.0",
"@ionic-native/file-transfer": "4.0.0",
"@ionic-native/image-picker": "4.0.0",
"@ionic-native/is-debug": "4.1.0",
"@ionic-native/media": "4.0.0",
"@ionic-native/media-capture": "4.0.0",
"@ionic-native/network": "4.0.0",
"@ionic-native/screen-orientation": "4.0.0",
"@ionic-native/splash-screen": "4.0.0",
"@ionic-native/status-bar": "4.0.0",
"@ionic-native/streaming-media": "4.0.0",
"@ionic-native/video-player": "4.0.0",
"@ionic/storage": "2.0.1",
2、报错信息
在cordova config.xml 中添加如下代码
<preference name="xwalkVersion" value="xwalk_core_library:23.53.589.4" />