最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - deviceready not fired after 5 seconds Cordova - Stack Overflow

programmeradmin1浏览0评论

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. /

The following is my configuration

Cordova version 5.3.1

Ionic version 1.6.4

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./docs/mon-issues/

The following is my configuration

Cordova version 5.3.1

Ionic version 1.6.4

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Sep 18, 2015 at 18:52 grane2212grane2212 7741 gold badge10 silver badges30 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 1

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.

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".......>

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 [email protected]

@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.

发布评论

评论列表(0)

  1. 暂无评论