Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

ios - iOS8 phonegap cordova network-information app crashes

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...