iOS8 phonegap cordova network-information app crashes

匿名 (未验证) 提交于 2019-12-03 01:18:02

问题:

I use

  • Xcode 6.1
  • iOS 8.1
  • cordova 4.0.0 (iOS 3.6.3)
  • org.apache.cordova.network-information 0.2.13

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" is executed and the [self sendPluginResult] call originates and EXC_BAD_ACCESS exception on the _callbackId variable.

I found many reports since cordova 3.1.0. Is this just not working anymore or did someone found a fix for this problem?

Thanks for any hints.

回答1:

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).

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!