Ionic:当已经安装'离子插件添加'时,未安装cordova-plugin-ionic插件 [英] Ionic: cordova-plugin-ionic plugin is not installed when ‘ionic plugin add’ says already installed
本文介绍了Ionic:当已经安装'离子插件添加'时,未安装cordova-plugin-ionic插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我看过其他类似的问题,但我仍然感到困惑。当我使用 ionic serve
运行我的应用时,我的控制台告诉我:
I have seen other similar questions but am still confused. When I run my app using ionic serve
, my console tells me:
ionic-pro.min.js:1 the cordova-plugin-ionic plugin is not installed. Install it for better device information for runtime errors.
但是当我跑步时:
cordova plugin add cordova-plugin-ionic --variable APP_ID=app_id --variable CHANNEL_NAME=Production
它说:
Plugin "cordova-plugin-ionic" already installed on android.
Plugin "cordova-plugin-ionic" already installed on browser.
Plugin "cordova-plugin-ionic" already installed on ios.
我有一种感觉这与我的其他问题有关,这是Ionic Pro的部署服务而不是按预期工作。
I have a feeling this is connected to one of my other issues, which is Ionic Pro's Deploy service not working as expected.
这是我的环境:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.14.0
ionic (Ionic CLI) : 3.14.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.1.2 browser 4.1.0 ios 4.1.1
Ionic Framework : ionic-angular 3.0.1
System:
ios-deploy : 1.9.1
ios-sim : 5.0.13
Node : v6.11.0
npm : 2.15.12
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Misc:
backend : pro
推荐答案
在你的app.component.ts文件中:
In your app.component.ts file :
在平台就绪之后声明rootpage值,如下所示。
declare rootpage value after platform ready like below.
export class MyApp {
rootPage:any;
constructor(platform: Platform, statusBar: StatusBar,splashScreen: SplashScreen) {
platform.ready().then(() => {
this.rootPage = HomePage;
statusBar.styleDefault();
splashScreen.hide();
});
}
}
这篇关于Ionic:当已经安装'离子插件添加'时,未安装cordova-plugin-ionic插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文