Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova build results in error on iOS after installing org.apache.cordova.network-information

Tags:

ios

cordova

Hi I just started with a fresh structure for a cordova project and I needed to install this plugin org.apache.cordova.network-information.

I am using cordova 3.5.0.

After installing it and running cordova build I got this error:

    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$ 

If I try to build from XCODE I get this error:

    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)
like image 936
isdcdev Avatar asked Jun 25 '14 14:06

isdcdev


People also ask

Does cordova work for iOS?

You can use cordova run ios --list to see all available targets and cordova run ios --target=target_name to run application on a specific device or emulator (for example, cordova run ios --target="iPhone-6" ). You can also use cordova run --help to see additional build and run options.

How do I check my cordova internet connection?

The best approach is to use cordova network information plugin which does the job for you seamlessly. This plugin provides information about the device's cellular and wifi connection, and whether the device has an internet connection. You check out the official github page of this plugin for more info on the same.

Which command is used to install cordova for all the users on a Mac machine?

The -g flag above tells npm to install cordova globally. Otherwise it will be installed in the node_modules subdirectory of the current working directory.


1 Answers

Sounds like the SystemConfiguration.framework was supposed to have been added automatically by the org.apache.cordova.network-information plugin but wasn't.

I ended up manually adding the SystemConfiguration.framework in Build Phases > Link Binary With Libraries per the comments in the following and it fixed it for me:

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

like image 156
SunshinyDoyle Avatar answered Oct 20 '22 20:10

SunshinyDoyle