Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2 device ready did not fire within 2000ms

I'm working within ionic 2 beta 11 on IOS platforms after run the app using ionic run ios a white screen appear and got the below message:

Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.

Any suggestion about that ? What's the problem exactly ?

like image 487
Mahmoud Ismail Avatar asked Oct 13 '16 07:10

Mahmoud Ismail


2 Answers

This could be happening due to several issues, so you'd have to try a few things:

  1. Reinstall the platform by running ionic state reset --platform
  2. Reinstall your plugins by running ionic state reset --plugins before doing this please check that all your plugins are included in your package.json file.
  3. Just like @joshmorony says here, try by changing the Content-Security-Policy from your index.html for this one:

    <meta http-equiv="Content-Security-Policy" content="default-src gap://ready file://* *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *”>
    
like image 86
sebaferreras Avatar answered Oct 22 '22 05:10

sebaferreras


As mentioned in a comment of the other answer, in new version of the CLI you should delete the plugins and platforms folders manually. Then run :

ionic cordova prepare
like image 6
Michael Laffargue Avatar answered Oct 22 '22 05:10

Michael Laffargue