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)
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With