在安装org.apache.cordova.network-information之后,Cordova构建在iOS上导致错误

isd*_*dev 7 ios cordova

嗨,我刚刚开始使用cordova项目的新结构,我需要安装这个插件org.apache.cordova.network-information.

我使用的是cordova 3.5.0.

安装它并运行cordova build之后我遇到了这个错误:

    Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[CDVReachability reachabilityWithAddress:] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[CDVReachability reachabilityWithHostName:] in CDVReachability.o
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[CDVReachability connectionRequired] in CDVReachability.o
      -[CDVReachability currentReachabilityStatus] in CDVReachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[CDVReachability stopNotifier] in CDVReachability.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/emulator/EconnectHybrid.app/EconnectHybrid normal i386
(1 failure)
Command finished with error code 65: /Users/dev/Development/ncoi-econnect-hybrid/platforms/ios/cordova/build 
Error: /Users/dev/Development/ncoi-econnect-hybrid/platforms/ios/cordova/build: Command failed with exit code 65
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)
isdc30408:ncoi-econnect-hybrid dev$ 
Run Code Online (Sandbox Code Playgroud)

如果我尝试从XCODE构建,我会收到此错误:

    Undefined symbols for architecture armv7:
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[CDVReachability connectionRequired] in CDVReachability.o
      -[CDVReachability currentReachabilityStatus] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[CDVReachability reachabilityWithAddress:] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[CDVReachability reachabilityWithHostName:] in CDVReachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[CDVReachability stopNotifier] in CDVReachability.o
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

Sun*_*yle 8

听起来像是SystemConfiguration.framework应该由org.apache.cordova.network-information插件自动添加,但事实并非如此.

我最后根据以下注释手动添加了SystemConfiguration.frameworkin Build Phases > Link Binary With Libraries,并为我修复了它:

https://issues.apache.org/jira/browse/CB-6443