I get this console message
我收到这个控制台消息
deviceready has not fired after 5 seconds.
5秒后,deviceready尚未解雇。
Channel not fired: onPluginsReady
频道未被解雇:onPluginsReady
Channel not fired: onCordovaReady
频道未被解雇: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.
控件永远不会进入ionic.Platform.ready函数。有趣的是,我的代码适用于Android设备,但不适用于iOS设备。
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/
到目前为止,我尝试过很多东西。我已尝试按照此链接中的疑难解答进行操作。 http://ngcordova.com/docs/common-issues/
The following is my configuration
以下是我的配置
Cordova version 5.3.1
Cordova版本5.3.1
Ionic version 1.6.4
离子版1.6.4
4 个解决方案
#1
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..
到index.html文件中的元标记。它应该看起来像......
<meta http-equiv="Content-Security-Policy".......>
#2
1
I had same issue on iOS .Spent almost 3 to 4 days .Finally any of these two workarounds worked for me
我在iOS上遇到了同样的问题。几乎3到4天。最后这两个解决方法中的任何一个都适用于我
1.add < meta http-equiv="Content-Security-Policy".......> to index.html
1.add 到index.html
2.downgrade platform to 4.0.0 (cordova platform update iOS@4.0.0
2.将平台降级到4.0.0(cordova平台更新iOS@4.0.0
#3
0
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.
window.cordova.plugins.Keyboard引起了一些问题,因为从Cordova 3.0版开始不推荐使用它。现在您需要使用window.cordova.require()语法来访问插件。
Also removing and adding the ios platform helped.The package.json gets messed up sometimes.
同时删除和添加ios平台帮助.package.json有时搞砸了。
#4
0
@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.
@ grane2212,你没有发布任何代码,所以很难调试这个。如果这不能回答您的问题,请发布您的index.html文件。
You may be loading your javascript support file from a CDN or the web. DO NOT DO THIS.
Load all *.js files locally.
您可能正在从CDN或Web加载您的javascript支持文件。不要这样做。在本地加载所有* .js文件。
Let me know, if this helps.
如果这有帮助,请告诉我。
#1
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..
到index.html文件中的元标记。它应该看起来像......
<meta http-equiv="Content-Security-Policy".......>
#2
1
I had same issue on iOS .Spent almost 3 to 4 days .Finally any of these two workarounds worked for me
我在iOS上遇到了同样的问题。几乎3到4天。最后这两个解决方法中的任何一个都适用于我
1.add < meta http-equiv="Content-Security-Policy".......> to index.html
1.add 到index.html
2.downgrade platform to 4.0.0 (cordova platform update iOS@4.0.0
2.将平台降级到4.0.0(cordova平台更新iOS@4.0.0
#3
0
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.
window.cordova.plugins.Keyboard引起了一些问题,因为从Cordova 3.0版开始不推荐使用它。现在您需要使用window.cordova.require()语法来访问插件。
Also removing and adding the ios platform helped.The package.json gets messed up sometimes.
同时删除和添加ios平台帮助.package.json有时搞砸了。
#4
0
@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.
@ grane2212,你没有发布任何代码,所以很难调试这个。如果这不能回答您的问题,请发布您的index.html文件。
You may be loading your javascript support file from a CDN or the web. DO NOT DO THIS.
Load all *.js files locally.
您可能正在从CDN或Web加载您的javascript支持文件。不要这样做。在本地加载所有* .js文件。
Let me know, if this helps.
如果这有帮助,请告诉我。