Cordova Network Plugin does not build on iOS -


having installed cordova-network-plugin so:

cordova plugin add cordova-network-plugin 

to working cordova project (build successful on ios previously), project inexplicably failed build ios (cordova build ios).

it builds fine android, produces following error message ios:

undefined symbols 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 architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation)  ** build failed **  following build commands failed: ld build/emulator/wowsuchapp.app/wowsuchapp normal i386 (1 failure) error code 65 command: xcodebuild args: -xcconfig,/users/doge/desktop/wowsuchapp/cordova/platforms/ios/cordova/build-debug.xcconfig,-project,wowsuchapp.xcodeproj,archs=i386,-target,wowsuchapp,-configuration,debug,-sdk,iphonesimulator,build,valid_archs=i386,configuration_build_dir=/users/doge/desktop/wowsuchapp/cordova/platforms/ios/build/emulator,shared_precomps_dir=/users/doge/desktop/wowsuchapp/cordova/platforms/ios/build/sharedpch error building 1 of platforms: error: /users/doge/desktop/wowsuchapp/cordova/platforms/ios/cordova/build: command failed exit code 2 may not have required environment or os build project error: /users/doge/desktop/wowsuchapp/cordova/platforms/ios/cordova/build: command failed exit code 2 @ childprocess.whendone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23) @ childprocess.emit (events.js:110:17) @ maybeclose (child_process.js:1015:16) @ process.childprocess._handle.onexit (child_process.js:1087:5) 

to me, seems plugin not compatible i386, though find hard believe. therefore tried compile armv7, using

cordova build ios --device 

the error message similar above, except alluding armv7 instead of i386.

the issue appears cordova doesn't add required frameworks ios project when add plugin.

most projects need audiotoolbox.framework (debugging).

cordova-plugin-network-information require systemconfiguration.framework.

cordova-plugin-contacts require addressbook.framework, addressbookui.framework, , coregraphics.framework.

to add framework:

  1. select project in xcode
  2. select target
  3. select build phases tab
  4. open link binaries libraries expander
  5. click +
  6. select desired framework , add project

Comments