deviceready not fired after 5 seconds Cordova

霸气de小男生 提交于 2020-07-22 04:23:05

问题


I get this console message

deviceready has not fired after 5 seconds.

Channel not fired: onPluginsReady

Channel not fired: onCordovaReady

when I use the following ionic code snippet.

ionic.Platform.ready(function(){
    // will execute when device is ready, or immediately if the device is already ready.
    // some code here. I am making calls to sqlite cordova plugin
});

The control never goes inside the ionic.Platform.ready function. Funny thing is that my code works on android devices but don't work on iOS devices.

I have tried doing a lot of stuff so far. I have tried following the troubleshooting given in this link. http://ngcordova.com/docs/common-issues/

The following is my configuration

Cordova version 5.3.1

Ionic version 1.6.4


回答1:


Try adding this if not already included..

http-equiv="Content-Security-Policy"

To meta tag in your index.html file. It should look like..

<meta http-equiv="Content-Security-Policy".......>



回答2:


I had same issue on iOS .Spent almost 3 to 4 days .Finally any of these two workarounds worked for me

1.add < meta http-equiv="Content-Security-Policy".......> to index.html

2.downgrade platform to 4.0.0 (cordova platform update iOS@4.0.0




回答3:


window.cordova.plugins.Keyboard was causing some issues as it is deprecated as of Cordova version 3.0. Now you need to use window.cordova.require() syntax to access the plugins.

Also removing and adding the ios platform helped.The package.json gets messed up sometimes.




回答4:


@grane2212, You did not post any code, so it is difficult to debug this. Please post your index.html file, if this does not answer your question.

You may be loading your javascript support file from a CDN or the web. DO NOT DO THIS.
Load all *.js files locally.

Let me know, if this helps.



来源:https://stackoverflow.com/questions/32659113/deviceready-not-fired-after-5-seconds-cordova

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!