Android: Deviceready has not fired after 5 seconds

2020-03-01 03:26发布

After update Cordova to v6.4.0 and Android platform to 6.0.0, my app don't work any more. I'm getting this:

deviceready has not fired after 5 seconds. cordova.js:1223
Channel not fired: onCordovaInfoReady cordova.js:1216
Channel not fired: onCordovaConnectionReady cordova.js:1216

I tried to remove all plugins and add it one by one. I found that is a problem with cordova-plugin-device and cordova-plugin-network-information. All my plugins are up to date

9条回答
走好不送
2楼-- · 2020-03-01 03:57

Solution:

put the call "cordova.js" to the last line in the page.

<script type="text/javascript" src="cordova.js"></script>
</body>
</html>

Greeting...

查看更多
戒情不戒烟
3楼-- · 2020-03-01 03:57

I dont know the real reason of this issue, But I tried removing cordova-plugin-whitelist and cordova-plugin-device from the plugins list and added them again. luckily that solved the issue,

查看更多
贪生不怕死
4楼-- · 2020-03-01 04:02

If you are testing on iphone , the problem is related to Content-Security-Policy , either remove it , or change the rules so it can run !

Also make sure cordova.js is added to the end of the html file .

<script type="text/javascript" src="cordova.js"></script> 
</body>
</html>
查看更多
登录 后发表回答