OGeek|极客世界-中国程序员成长平台

标题: javascript - deviceready 5 秒后未触发​​ Cordova [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 16:17
标题: javascript - deviceready 5 秒后未触发​​ Cordova

我收到此控制台消息

deviceready has not fired after 5 seconds.

Channel not fired: onPluginsReady

Channel not fired: onCordovaReady

当我使用以下 ionic 代码 fragment 时。

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
});

控件永远不会进入 ionic.Platform.ready 函数内部。有趣的是,我的代码可以在 android 设备上运行,但不能在 iOS 设备上运行。

到目前为止,我已经尝试过很多事情。我已尝试按照此链接中给出的故障排除进行操作。 http://ngcordova.com/docs/common-issues/

以下是我的配置

Cordova version 5.3.1

Ionic version 1.6.4



Best Answer-推荐答案


window.cordova.plugins.Keyboard 导致了一些问题,因为它在 Cordova 版本 3.0 已被弃用。现在您需要使用 window.cordova.require() 语法来访问插件。

还有助于删除和添加 ios 平台。package.json 有时会搞砸。

关于javascript - deviceready 5 秒后未触发​​ Cordova,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32659113/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4