【发布时间】:2017-04-17 15:53:49
【问题描述】:
当我使用
在我的 iOS 设备上运行我的 ionic 应用程序时,我的 deviceready 不会触发或触发很晚ionic run ios --device -lcs
我删除了所有带有ionic plugin rm ...的插件,删除了plugins/目录的内容并重新安装了它们。
我还用ionic platform rm/add ios删除并重新安装了ios平台。
我被这个困住了。
iPhone (6+) 运行 iOS 10。
我正在使用 ionic 1,以及最后一个 ionic CLI。
编辑:我一一删除了所有插件,看来问题是由于cordova-plugin-network-information和cordova-plugin-device造成的。
Process 663 detached
(lldb)
(node:26790) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
14 030280 warn Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
15 030605 info [object Object]
16 033286 log deviceready has not fired after 5 seconds.
17 033290 log Channel not fired: onCordovaInfoReady
18 033293 log Channel not fired: onCordovaConnectionReady
19 363977 log DEVICE READY FIRED AFTER, 32259, ms
我的 run.js、AppCtrl.js 和我的主视图的控制器被封装在 $ionicPlatform.ready(function () {..});`
我的内容安全政策是:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; connect-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ws: *;">
【问题讨论】:
-
请附上minimal reproducible example 来证明这一点。
-
我添加了错误码
-
但是我的应用有10多个插件,而且代码量很大!
-
好的,如果我删除插件“cordova-plugin-network-information”,设备会在 1 秒后触发
-
好的,我明白了,我也在做同样的事情,好的,我安装了所有插件,除了设备和网络信息....并且 deviceready 在 ios10 上不到一秒就触发了。也许离子有一个错误
标签: ios cordova ionic-framework device