[英]“deviceready has not fired after 5 seconds” cordova 3.5.0-0.2.1
[英]deviceready not fired after 5 seconds Cordova
我收到此控制台消息
5 秒后 deviceready 未觸發。
頻道未觸發:onPluginsReady
頻道未觸發:onCordovaReady
當我使用以下離子代碼片段時。
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/
以下是我的配置
科爾多瓦版本 5.3.1
離子版本 1.6.4
window.cordova.plugins.Keyboard導致了一些問題,因為它從Cordova 版本 3.0 開始被棄用。 現在您需要使用window.cordova.require()語法來訪問插件。
刪除和添加 ios 平台也有幫助。 package.json 有時會搞砸。
如果尚未包含,請嘗試添加此內容。
http-equiv="Content-Security-Policy"
在 index.html 文件中使用元標記。 它應該看起來像..
<meta http-equiv="Content-Security-Policy".......>
我在 iOS 上遇到了同樣的問題。花了將近 3 到 4 天。最后這兩種解決方法中的任何一種都對我有用
1.在index.html中添加<meta http-equiv="Content-Security-Policy"......>
2.降級平台到4.0.0(cordova平台更新iOS@4.0.0
@grane2212,您沒有發布任何代碼,因此很難調試。 如果這不能回答您的問題,請發布您的 index.html 文件。
您可能正在從 CDN 或網絡加載您的 javascript 支持文件。 不要這樣做。
在本地加載所有 *.js 文件。
如果這有幫助,請告訴我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.