我可以使用ionic cordova build ios
构建我的离子项目,但是当我使用--release --prod
选项进行构建时,会出现此错误:
Error: Metadata version mismatch for module
node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3
我知道这是一个@ ionic-native插件版本问题,但我无法修复。我发现了很多git问题或论坛,但没有人拥有与我相同的版本。
这是我的依赖项:
"dependencies": {
"@angular/common": "^4.4.7",
"@angular/compiler": "^4.4.7",
"@angular/compiler-cli": "^4.4.7",
"@angular/core": "^4.4.7",
"@angular/forms": "^4.4.7",
"@angular/http": "^4.4.7",
"@angular/platform-browser": "^4.4.7",
"@angular/platform-browser-dynamic": "^4.4.7",
"@firebase/app": "^0.1.10",
"@ionic-native/background-mode": "^4.17.0",
"@ionic-native/camera": "^4.17.0",
"@ionic-native/core": "^4.17.0",
"@ionic-native/facebook": "^4.17.0",
"@ionic-native/file": "^4.17.0",
"@ionic-native/file-transfer": "^4.17.0",
"@ionic-native/firebase-analytics": "^4.17.0",
"@ionic-native/google-maps": "^4.15.1",
"@ionic-native/google-plus": "^4.17.0",
"@ionic-native/in-app-browser": "^4.17.0",
"@ionic-native/in-app-purchase": "^4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/media": "^4.17.0",
"@ionic-native/native-audio": "^4.17.0",
"@ionic-native/social-sharing": "^4.17.0",
"@ionic-native/splash-screen": "^4.17.0",
"@ionic-native/status-bar": "^4.17.0",
"@ionic-native/vibration": "^4.17.0",
"@ionic/storage": "^2.0.1",
"@ngx-translate/core": "6.0.1",
"@ngx-translate/http-loader": "0.0.3",
"@types/stripe": "^3.0.0",
"ajv": "^5.5.2",
"angular-svg-round-progressbar": "1.1.1",
"angular2-swiper": "^0.8.1",
"angularfire2": "^5.1.0",
"cordova-android": "^6.2.3",
"cordova-android-support-gradle-release": "^1.2.0",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.5.5",
"cordova-plugin-app-event": "^1.2.1",
"cordova-plugin-background-mode": "^0.7.2",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-facebook4": "^1.9.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-firebase-analytics": "^0.14.0",
"cordova-plugin-googleplus": "^5.3.2",
"cordova-plugin-inappbrowser": "^1.7.2",
"cordova-plugin-inapppurchase": "^1.2.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativeaudio": "^3.0.9",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.1",
"cordova-plugin-vibration": "^2.1.6",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.3",
"cordova-support-android-plugin": "^0.3.7",
"cordova-support-google-services": "^1.2.1",
"de.appplant.cordova.plugin.local-notification": "^0.8.5",
"dropbox": "^2.5.7",
"es6-promise": "^4.2.5",
"es6-promise-plugin": "^4.1.0",
"firebase": "^4.3.0",
"ionic-angular": "3.9.2",
"ionic-image-loader": "^4.1.1",
"ionic-plugin-keyboard": "^2.2.1",
"ionic3-calendar": "git+https://github.com/ReaperSoon/ionic3-calendar.git",
"ionicons": "4.4.8",
"jquery": "^3.2.1",
"localforage": "^1.7.3",
"localforage-cordovasqlitedriver": "^1.6.0",
"ng-imgcache": "^1.0.1",
"ng2-simple-timer": "^1.3.5",
"promise-polyfill": "6.0.2",
"rxjs": "5.4.3",
"setimmediate": "^1.0.5",
"stripe": "^4.25.0",
"superagent": "^3.7.0",
"sw-toolbox": "3.6.0",
"ts-md5": "^1.2.4",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.1",
"@ionic/lab": "1.0.9",
"in-app-purchase": "^1.10.6",
"typescript": "2.4.0"
},
有人可以帮我找到我的依赖版本有什么问题吗?
预先感谢
答案 0 :(得分:0)
尝试将所有插件从ionic更新到最新 https://www.npmjs.com/package/cordova-check-plugins
全局安装:
Where
然后从您的Cordova项目的根目录开始运行。您可以选择交互式地或自动地更新过时的插件,例如
<p class="err" danger padding-left
*ngIf="(!addbookingForm.controls.ITEMS.controls[0].controls.NO_OF_ITEMS.valid)">
Invalid number of items</p>
答案 1 :(得分:0)
您的import {Component, OnInit,AfterViewInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
@Component({
selector: 'stepper-label-position-bottom-example',
templateUrl: 'stepper-label-position-bottom-example.html',
styleUrls: ['stepper-label-position-bottom-example.css'],
})
export class StepperLabelPositionBottomExample implements OnInit, AfterViewInit {
firstFormGroup: FormGroup;
secondFormGroup: FormGroup;
color1:string = 'green';
color2:string = 'yellow';
color3:string = 'red';
constructor(private _formBuilder: FormBuilder) {}
ngOnInit() {
this.firstFormGroup = this._formBuilder.group({
firstCtrl: ['', Validators.required]
});
this.secondFormGroup = this._formBuilder.group({
secondCtrl: ['', Validators.required]
});
}
ngAfterViewInit(){
document.querySelector("body").style.cssText = "--my-var1: "+this.color1;
(<HTMLElement>document.querySelector('.secondClass')).style.cssText = "--my-var2: "+this.color2;
(<HTMLElement>document.querySelector('.firstClass')).style.cssText = "--my-var3: "+this.color3;
}
}
的{{1}}版本期望使用Angular 5,但是您已列出Angular 4的依赖项(@ionic-native/core
)。
您可以升级到^4.17
和^4.4.7
请记住也将其他角度依赖项也更新为相同版本(@ angular / common,@ angular / compiler等)
注意:您某些依赖于角度v4的依赖项也可能需要升级。