重现步骤:1.构建ionic应用项目,并添加以下依赖关系2.使用ionic服务。运行ionic服务
错误信息。
compiler.js:2420 Uncaught Error: Can't resolve all parameters for setupPlatform: (?, [object Object], [object Object]).
at syntaxError (compiler.js:2420)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:21576)
at CompileMetadataResolver._getFactoryMetadata (compiler.js:21475)
at CompileMetadataResolver.getProviderMetadata (compiler.js:21708)
at compiler.js:21638
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (compiler.js:21598)
at compiler.js:21220
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:21211)
我的依赖关系。
"dependencies": {
"@angular/common": "^8.2.7",
"@angular/core": "8.2.7",
"@angular/forms": "8.2.7",
"@angular/platform-browser": "8.2.7",
"@angular/platform-browser-dynamic": "8.2.7",
"@angular/router": "^8.2.7",
"@ionic-native/app-rate": "^5.24.0",
"@ionic-native/core": "^5.24.0",
"@ionic-native/facebook": "^5.24.0",
"@ionic-native/in-app-purchase-2": "^5.24.0",
"@ionic-native/ionic-webview": "^5.15.1",
"@ionic-native/local-notifications": "^5.24.0",
"@ionic-native/social-sharing": "^5.24.0",
"@ionic-native/splash-screen": "^5.24.0",
"@ionic-native/status-bar": "^5.24.0",
"@ionic-native/wheel-selector": "^5.24.0",
"@ionic/angular": "^5.1.0",
"@ionic/lab": "^3.1.4",
"@ionic/storage": "^2.2.0",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "^4.0.0",
"@types/chart.js": "^2.7.52",
"@types/cordova": "^0.0.34",
"@types/node": "^12.6.8",
"aws-amplify": "^3.0.10",
"aws-appsync": "^3.0.3",
"cc.fovea.cordova.purchase": "^10.1.1",
"chart.js": "^2.9.3",
"cordova-android": "^8.1.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-advanced-http": "^2.4.1",
"cordova-plugin-apprate": "^1.5.0",
"cordova-plugin-cocoapod-support": "1.6.2",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-facebook4": "^6.4.0",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-purchase": "git+https://github.com/j3k0/cordova-plugin-purchase.git#v9",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.7",
"cordova-sqlite-storage": "^5.0.0",
"cordova-wheel-selector-plugin": "^1.1.7",
"debug": "^4.1.1",
"es6-promise-plugin": "^4.2.2",
"graphql": "^0.11",
"graphql-tag": "^2.10.3",
"ionic-angular": "^3.9",
"ionic-tooltips": "^3.1.0",
"ionicons": "^4.6.3",
"moment": "2.24.0",
"ngx-ionic-image-viewer": "^0.7.0",
"q": "^1.5.1",
"rxjs": "^6.5.5",
"rxjs-compat": "^6.5.5",
"sw-toolbox": "3.6.0",
"turndown": "^6.0.0",
"video.js": "^7.5.4",
"zone.js": "^0.9",
"core-js": "^3.6.5",
"browserslist": "^4.12.0"
},
"devDependencies": {
"@angular/compiler": "^8.2.7",
"@angular/compiler-cli": "^8.2.7",
"@angular-devkit/schematics": "^8.2.7",
"@angular-devkit/core": "^8.2.7",
"@ionic/app-scripts": "^3.2.4",
"@angular/cli": "^8.2.7",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"jest": "^23.6.0",
"jest-preset-angular": "^6.0.2",
"promise.prototype.finally": "^3.1.0",
"ts-loader": "^7.0.2",
"ts-node": "^8.0.2",
"tslint-config-airbnb": "^5.11.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "3.5.3"
},
Ionic Info:
Ionic:
Ionic CLI : 6.7.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : ionic-angular 3.9.10
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : none
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 18 other plugins)
Utility:
cordova-res : 0.14.0
native-run : 1.0.0
System:
Android SDK Tools : 26.1.1 (/Users/matthias/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v14.0.0 (/usr/local/Cellar/node/14.0.0/bin/node)
npm : 6.14.4
OS : macOS Catalina
Xcode : Xcode 11.4.1 Build version 11E503a
试着把Cordova降级到稳定版-8.1.2。在Cordova 9.0.0中部分功能中断。npm i [email protected]。