Ionic Native: deviceready did not fire within 5000ms

Hi all,

I’ve searched the forum and the web for a solution to this, and all I see are suggestions like try with less plugins and stuff like that. In my book that is not really a solution, if I actually need those plugins. I know, I know I can build and run it.

This happens to me on Android devices when I do “ionic serve -c” from the terminal and run it through DevApp. I experience no problems on iOS devices.

Has anyone found a solution for this?

Cheers

This is actually (unfortunately) a very common warning. These warnings are fired by plugins and are not something within the reach of your control. It has very much to do with the way cordova is built and implemented, but it is definitely something you shouldn’t worry about.

Okay, but problem is, it seems to stop some of my javescript from running/executing.

Is there a way around this? Now we’re talking about workarounds instead of solutions. Also is there a specific reason this is only on android devices, I’m experiencing this?

No I’m not talking about workarounds or solutions, I’m just telling you this is a plugin warning. Not something that should stop your code from running, unless there’s something in your code itself that stops it from running. Could you please provide some context as in what isn’t working as expected and how you think it is related to this warning?

This could just as easily happen on iOS as well, but probably the devices are faster in booting up you’re app and thus the chance of getting deviceready did not fire within … exceptions are less common.

Okay, some of this might have been due to my lack of experience with Ionic and Angular. I’ve now found, the problem is not with the warning itself, which sound reasonable, but the fact that device.ready/platform.ready isn’t triggered at all. In my home class contructor, I have an platform.ready to make sure the DOM tree is complete, because I have some scripts which need to do stuff to it. If I have some scripts that need to be sure of the DOM tree is present, how would I go about that in Ionic/Angular?

Okay, after searching a little for dom tree completion in Angular, I’ve now moved my function calls to ngAfterViewInit which seems to have done the trick - don’t know if this is best practice, or if theres a better way to do this.

Are you not seeing the warning message after you moved the code from constructor ot ngAfterViewInit, so after moving the code there deviceready has fired less than 5000ms?
why does the message suggests to un-inistall & reinstall all plugins as first choice if this has remedy in our code? the warning message leaves us really puzzling?

^ same question as above @2ndeffect ?