15

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 ?

sebaferreras
  • 44,206
  • 11
  • 116
  • 134
Mahmoud Ismail
  • 1,617
  • 4
  • 27
  • 51

2 Answers2

10

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' *”>
    
sebaferreras
  • 44,206
  • 11
  • 116
  • 134
  • 4
    According to these two threads: https://github.com/driftyco/ionic-cli/issues/904 and https://github.com/driftyco/ionic-cli/issues/1324 , the `state` commads are deprecated. Instead, while adding the platform and plugins `--save` is used to add the same to the `config.xml`. To reset plugins and platform, delete the respective folders and issue `ionic prepare` – Musa Haidari Dec 18 '16 at 09:46
  • 2
    `ionic state reset --plugins` solved my problem in fast way, thanks – fifth Mar 03 '17 at 05:50
  • none of this worked for me. i am using ionic 1 with 21 plugins – Louis Jun 10 '17 at 20:36
  • Unless you have a copy of project please don't remove/reset plugins. Because sometimes when you try to add plugins it will give very weird errors especially with plugins like Cordova push. I tried all the above and nothing worked for me. – Vasanth Sep 04 '17 at 05:27
  • @Vasanth you can always remove the platform and then add the plugins again. What errors did it throw? – sebaferreras Sep 04 '17 at 05:41
  • Just now I did ionic state reset --plugins all the plugins that I had in my project was removed.Except the 5 plugins(keyboard, console, status bar etc) that will be added during project creations. – Vasanth Sep 04 '17 at 06:27
  • But before running that command, were the removed plugins added in the `package.json` file and in the `config.xml` file? If they were not included there (by using the `--save` flag) when installing them, the CLI won't know that they must be added when running `ionic state reset --plugins ` – sebaferreras Sep 04 '17 at 07:11
6

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
Michael Laffargue
  • 10,116
  • 6
  • 42
  • 76