当我在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: *;">