我的所有插件都出现此错误。它显示我的所有插件都没有安装,但它们是。
警告:Native:尝试调用StatusBar.styleDefault,但未安装StatusBar插件。
我看到一篇类似的文章建议确保代码不会在platform.ready之外执行,但这似乎不是我的问题
我的package.json如下
{
"name": "ppc",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@ionic-native/camera": "^4.5.2",
"@ionic-native/core": "4.4.0",
"@ionic-native/device-orientation": "^4.6.0",
"@ionic-native/diagnostic": "^4.7.0",
"@ionic-native/email-composer": "^4.6.0",
"@ionic-native/file-opener": "^4.5.3",
"@ionic-native/geolocation": "^4.7.0",
"@ionic-native/google-maps": "^4.6.0",
"@ionic-native/in-app-browser": "^4.6.0",
"@ionic-native/local-notifications": "^4.7.0",
"@ionic-native/screen-orientation": "^4.5.2",
"@ionic-native/social-sharing": "^4.6.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/sqlite": "^4.5.2",
"@ionic-native/status-bar": "4.4.0",
"@ionic-native/toast": "^4.5.2",
"@ionic-native/transfer": "^3.14.0",
"@ionic-native/youtube-video-player": "^4.5.3",
"@ionic/storage": "2.1.3",
"convert-units": "^2.3.4",
"cordova-android": "^6.4.0",
"cordova-ios": "4.5.4",
"cordova-plugin-badge": "^0.8.7",
"cordova-plugin-camera": "^4.0.2",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-device-orientation": "^1.0.7",
"cordova-plugin-email-composer": "^0.8.15",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git#2.6.0",
"cordova-plugin-inappbrowser": "^2.0.2",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-screen-orientation": "^3.0.1",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.3.2",
"cordova-plugin-youtube-video-player": "^1.0.6",
"cordova.plugins.diagnostic": "^4.0.5",
"es6-promise-plugin": "^4.2.2",
"haversine": "^1.1.0",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"ng2-search-filter": "^0.3.1",
"ng2-validation": "^4.2.0",
"rm": "^0.1.8",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"typings": "^2.1.1",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.6",
"typescript": "2.4.2",
"ws": "3.3.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"ionic-plugin-keyboard": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-camera": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
},
"cordova-plugin-device-orientation": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-email-composer": {},
"cordova.plugins.diagnostic": {},
"cordova-plugin-local-notification": {}
},
"platforms": [
"android",
"ios"
]
}
}
请协助。这只发生在IOS上。 Android很好。在模拟器和设备上进行测试。
答案 0 :(得分:1)
尝试删除ios平台并再次添加它将起作用。 试试这个命令: -
cordova platform rm ios
cordova platform add ios
答案 1 :(得分:1)
试试sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
。
它对我有用