Reputation: 1680
Ionic2 Native Error: deviceready did not fire within 2000ms
THIS CAUSES WHITE SCREEN - WHEN APP START!
Any Solution??
Upvotes: 1
Views: 2064
Reputation: 61
First make sure your plugins are listed in package.json, then do the following:
ionic platform rm android
ionic platform add android
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="ShowSplashScreen" value="true"/>
<preference name="SplashShowOnlyFirstTime" value="false"/>
<preference name="SplashScreenDelay" value="0"/>
<preference name="FadeSplashScreen" value="false"/>
<preference name="FadeSplashScreenDuration" value="0"/>
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
<preference name="SplashScreen" value="screen"/>
...
and hide it on device ready at src/app/app.component.ts
...
export class MyApp {
constructor(platform: Platform) {
platform.ready().then(() => {
this.hideSplashScreen();
StatusBar.styleDefault();
});
}
hideSplashScreen() {
if (Splashscreen) {
Splashscreen.hide();
}
}
}
Upvotes: 3
Reputation: 6094
You could do ionic state reset
. This would remove all the plugins and build everything from the cordovaPlugins
in package.json . Make sure you have everything in there. This would depend on whether you have used ionic plugin
or cordova plugin
.
And this command might be deprecated as cordova
now supports this feature.
edit
You could use ionic state save
to save all plugins to package.json
Upvotes: 1