问题描述
Ionic2原生错误:设备已在2000ms内未启动
Ionic2 Native Error: deviceready did not fire within 2000ms
这会导致白屏 - 应用程序启动时开始!
任何解决方案??
推荐答案
首先确保您的插件列在package.json中,然后执行以下操作:
First make sure your plugins are listed in package.json, then do the following:
离子平台rm android
ionic platform add android
我也遇到了一些启动时出现白屏的splashscreen插件问题,因此请确保在config.xml中设置配置。例如:
I also had some issues with the splashscreen plugin causing a white screen on startup, so make sure the configuration is set in config.xml. For example:
...
< preference name =ShowSplashScreenvalue =true/>
< preference name =SplashShowOnlyFirstTimevalue =false/>
< preference name =SplashScreenDelayvalue =0/>
< preference name =FadeSplashScreenvalue =false/>
< preference name =FadeSplashScreenDurationvalue =0/>
< preference name =ShowSplashScreenSpinnervalue =false/>
< preference name =AutoHideSplashScreenvalue =false/>
< preference name =SplashScreenBackgroundColorvalue =0xFFFFFFFF/>
< preference name =SplashScreenvalue =screen/>
...
并将其隐藏在src / app / app.component.ts上的设备上
and hide it on device ready at src/app/app.component.ts
...
导出类MyApp {
构造函数(平台:平台){
platform.ready()。then( ()=> {
this.hideSplashScreen();
StatusBar.styleDefault();
});
}
hideSplashScreen(){
if(Splashscreen){
Splashscreen.hide();
}
}
}
这篇关于Angular2 Ionic2本机错误deviceready在ms内没有激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!