10

Right this has become a right pain I have been looking at it for 2 days now and can't seem to solve it. Here is the error I am getting.

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

I have added SystemConfiguration.framework and it doesn't seem to want to do anything with it as this error just won't go away. I have looked at quite a few of the same problem but a lot of them done confirm any answers. This kind of just developed over the weekend when no one had touched it. Can anyone help.

EDIT Forgot to add this bit.

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration, missing required architecture armv7 in file

EDIT

Right Thanks to @gaige I have found a problem; there is an extra slash just before SystemConfiguration.framework that shouldn't be there. I have removed the framework and re-added and that has not helped. How can I remove this extra slash?

Nate
  • 31,017
  • 13
  • 83
  • 207
Popeye
  • 11,839
  • 9
  • 58
  • 91
  • There's an odd extra slash in the framework path, which might be affecting that (or not), can you remove and re-add the framework? My copy of the frameworks there definitely have both v6 and v7, so that should be OK. – gaige Jun 07 '12 at 21:25
  • @gaige I have removed and re-added the framework and that slash is still there is there any way I can remove that slash as I have tried to access the file through the terminal now and it doesn't work with it but does without it. – Popeye Jun 08 '12 at 08:14
  • 1
    UNIX systems usually don't fail because of an extra slash. I guess it's possible. Can you verify that the file in question does actually have both architectures? run `lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration` – Nate Jun 08 '12 at 08:43
  • 1
    and if you are concerned about the extra slash, can you open your project.pbxproj file in a text editor, and look for the line that contains the framework path? something like this: `name = SystemConfiguration.framework; path = System/Library/ ...` – Nate Jun 08 '12 at 08:44
  • 1
    that path also doesn't look familiar to me. when I create a project with SystemConfiguration.framework, it's using the one here: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/SystemConfiguration.framework. i actually tried deleting the file under /Applications/Xcode.app, and rebuilt, and it worked fine. so, I'm not sure why you're using that file. did you explicitly add the framework to your project? if so, how? – Nate Jun 08 '12 at 08:57
  • @Nate This was the output after running lipo -info "x86_64 i386 ppc7400" – Popeye Jun 08 '12 at 08:58
  • 1
    Ok, that looks wrong. You want to see this: `Architectures in the fat file: SystemConfiguration are: armv6 armv7` – Nate Jun 08 '12 at 08:59
  • 1
    so, now my follow-up again is "how did you add that framework in Xcode?". when you picked it, maybe you manually navigated to that location under /Applications/Xcode.app? – Nate Jun 08 '12 at 09:00
  • @Nate The thing is It was working last Friday and I came in a few days ago and it wasn't no one has touched it, the Mac has been locked all weekend it just decided to stop working. That Has been a huge help thanks. Can you add your comments as an answer and I will accept it. – Popeye Jun 08 '12 at 09:05
  • @Popeye - to respond to your comment on SciFi.SE, look in my SFF profile. There's a link to a blog explaining details. Feel free to share your assessment of my rudeness on SFF chat and thanks for the kind words! This comment will self-destruct in 24 hours :) – DVK Dec 27 '13 at 21:28
  • I've added a further experience although the problem here was solved. It is meant to help more people and to widen the scope. Thanks for all the answers and the effort here. – peter_the_oak Jun 30 '14 at 14:56

3 Answers3

8

Normally, extra slashes won't muck up a UNIX-like build process.

But, you do need to make sure the armv7 architecture is inside the framework file that your build is trying to use. To do this, use the lipo -info command at the command line:

lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer‌​/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/Sy‌​stemConfiguration

You should see output like this:

Architectures in the fat file: SystemConfiguration are: armv6 armv7

If you don't, your project is probably set up to link to the wrong version of the SystemConfiguration.framework. There's multiple versions of that framework on your machine. So, I would verify the path of the framework (i.e. SystemConfiguration) that you have in your project.

Normally, I would expect that file to be something like this (adjusted for the OS version you're using):

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Lib‌​rary/Frameworks/SystemConfiguration.framework
Nate
  • 31,017
  • 13
  • 83
  • 207
0

I have had this problem for about 8 hrs with a Cordova project and the org.apache.cordova.network-information plugin. By the answers above and several other answers, I was encouraged to search in the section Project > Target > Build Phases > Link Binary with Libraries of Xcode, which was right.

But although SCNetworkReachabilityCreateWithAddress is defined in SystemConfigration.framework, I was not able to get rid of the linker errors by systematically adding and removing this and other libraries.

Finally, I created a new project with the plugin and copied the framework constellation exactly as the original was. Now it's working.

Conclusion:

  • If possible, create a new project with the necessary extensions and copy the constellations from it. It might help.
  • Sometimes, a library is too much included, so uncheck it. Sometimes it is the other way round.
  • To dig deeper, check the SystemConfiguration.framework as described in the outstanding answers above. It might mismatch the target architecture. Further, check for strange chars in build including paths.
peter_the_oak
  • 3,529
  • 3
  • 23
  • 37
0

I simply cleaned and restarted xcode and it worked.

Mona
  • 5,939
  • 3
  • 28
  • 33