问题描述
我用
- Xcode 6.1
- iOS 8.1
- cordova 4.0.0 (iOS 3.6.3)
- org.apache.cordova.network-information 0.2.13
首先,当我添加插件时,它从不添加 SystemConfiguration.framework.我需要手动将它添加到构建阶段.
First, when I add the plugin it never adds the SystemConfiguration.framework. I need to add it manually to the Buiild Phase.
完成此操作后,应用程序可以构建,但它会在任何离线事件中崩溃.
Once this is done, the app can build but the it crashes on any offline event.
updateReachability"被执行,[self sendPluginResult] 调用发起,_callbackId 变量上的 EXC_BAD_ACCESS 异常.
"updateReachability" is executed and the [self sendPluginResult] call originates and EXC_BAD_ACCESS exception on the _callbackId variable.
从cordova 3.1.0 开始我发现了很多报告.这只是不再起作用还是有人找到了解决此问题的方法?
I found many reports since cordova 3.1.0. Is this just not working anymore or did someone found a fix for this problem?
感谢您的任何提示.
推荐答案
我好像发现了问题.一旦您在 XCode 项目(项目-> 构建设置)中禁用了 ARC(自动引用计数),网络信息插件似乎会导致崩溃.所以我通过将选项设置回 YES 来修复它(在 Target 和 Project 中).
It looks like I found the problem. Once you have ARC (Automatic Reference Counting) disabled in your XCode Project (Project->Build Settings) the Network-Information Plugin seems to cause a crash. So I fixed it by setting the option back to YES (in both Target & Project).
但就我而言,我有一些类会导致构建失败并显示 ARC YES.因此,我为 Project->Build Phases->Compile Sources 中的每个类添加了一个标志 -fno-objc-arc
.
But in my case I had some classes which causes the build to fail with ARC YES. Therefore I added a flag -fno-objc-arc
for each those classes in Project->Build Phases->Compile Sources.
这篇关于iOS8 phonegap cordova 网络信息应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!