50

My app is crashing with the message:

dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate
Referenced from: /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS Expected in: /System/Library/Frameworks/CFNetwork.framework/CFNetwork in /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS (lldb)

when I try to build and Run. When I remove the CFNetwork from my project, it works, I don't know why.

I just installed Xcode6Beta and opened my project. It was working fine on Xcode5.1.

UPDATE:

It works fine on iOS simulator with Xcode 6, the problem is on my device running iOS 7.1.1.

UPDATE 2:

The selected answer below worked for me, although I already had foundation framework explicit added to my project, I had to remove it and add it again. Problem solved, at least, for now. :)

4
  • 3
    Yep, mine does that as well. Runs fine in Xcode 5.1 iOS7.1, but gives the exact same error (except the target name of course) in Xcode6 iOS8... It suspect it's related to some HTTPS calls I do in the app. But since I don't do anything advanced/manually in that regard, I might think it's a bug in the beta version.
    – Elechtron
    Jun 5, 2014 at 7:56
  • 1
    Yes, I think you are right. Since I use parse.com for backend, I don't even know where this is happening. But surely some parse commands I use are making the network calls and returning the error.
    – Jorge
    Jun 5, 2014 at 11:43
  • I'm not sure wether we are allowed to talk about xcode6 in public as apple is only sharing this app in the beta section. Xcode5 and earlier doesn't have this issue. But maybe the next beta solve this problem
    – Vinh
    Jun 16, 2014 at 9:55
  • This post solved the problem for me: <stackoverflow.com/questions/24058543/…>
    – WOODE Soft
    Jul 11, 2014 at 14:26

11 Answers 11

89
+50

Edited to include two possible steps you need to take:

  1. Make sure you have Foundation framework to your project. (Remove and add it again to be sure).
  2. Make sure the Foundation framework include is before CFNetwork.

There seems to be a change in which headers include what in iOS8.0 (the glextensions file, for example, is no longer in the top header). If you explicitly add Foundation framework to your project, it will build fine. Making CFNetwork optional will, of course, lead to failures and is only a solution for the build error and not a solution overall.

enter image description here

12
  • 2
    It was already in my project, but I removed it and inserted again. It seems like it's working now. Not sure what happened there, though. Let me run a few tests and I'll send you feedback. Thanks.
    – Jorge
    Jun 8, 2014 at 21:20
  • @Jorge I've seen problems with state in the past too where the pbxproj gets confused so good thinking removing/adding. I'll edit to include that trick. My project has been working well after this, hope yours does as well.
    – plluke
    Jun 8, 2014 at 23:48
  • Just changed CFNetwork to optional, figured I should check online, and then saw your post. Thanks for saving me some future headaches... Jun 10, 2014 at 14:59
  • 1
    For convenience, it was sufficient for me just to uncheck the Target membership checkbox for Foundation.framework and check it again.
    – Gary Makin
    Jun 20, 2014 at 6:18
  • 2
    Actually this do not solve the problem! what solves is the other answer from Lap.felix: Reorder your frameworks to have Foundation before CFNetwork. Jul 3, 2014 at 11:02
38

I had a similar issue with UIAlertAction

dyld: Symbol not found: _OBJC_CLASS_$_UIAlertAction Referenced from: /var/mobile/Applications/ ....app/ ... Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/ ....app/ ...

Making UIKit.frameWork Optional solved my issue. In your case I am guessing, making your CFNetwork.framework optional will solve your problem too.

Make your <code>CFNetwork.framework</code> optional

3
  • Thanks, I'll try. But I'm worried if on doing that, I may get a crash when the framework is needed. And I wont know until it happens, since I use a few API's that make network connections. Does that make sense?
    – Jorge
    Jun 5, 2014 at 15:01
  • @Jorge I couldn't find any documentation on that. But my crash solved and app working as usual. I know because I have tested. We could never be sure without testing network connections on the app. Jun 5, 2014 at 15:57
  • @Jorge btw does it still crash after making the framework optional? Jun 5, 2014 at 16:01
16

Re-ordering in XCode didn't do the trick; I'm using Cocoapods, which creates a Pods.xcconfig file. This has a OTHER_LDFLAGS line. I put -framework Foundation as the first entry, and that's made my project work.

OTHER_LDFLAGS = -framework Foundation -ObjC …

(Beware, this file gets re-generated each time you pod update.)

1
  • thanks, it take me out. Cocoapods configuration overwrite the xcode. This is the solution for cocoapoders.
    – Nickolas
    Sep 13, 2014 at 7:46
11

Reorder your frameworks to have Foundation before CFNetwork.

That's a temporary fix to something that is obviously a bug in Xcode 6.

1
  • @dasblinkenlight i just edited my answer for something that really works. Thanks Jun 17, 2014 at 2:20
6

I ran into this exact problem at WWDC. I spoke to a couple of Apple engineers who told me this is a bug in the SDK caused by moving some symbols between CFNetwork & Foundation, and that it would be resolved in the next release, due very soon. You can work around it in some cases by playing with the order frameworks are imported, but it won't always work.

2
  • 4
    Thanks for the info. FWIW, I'm still seeing the error in beta 2. Jun 18, 2014 at 14:50
  • Issue still present in Beta 5, just FYI Aug 11, 2014 at 15:00
2

I had the same problem using sqlite3 with Xcode 6.3 on a device running iOS 8.1.3 and so using sqlite3 v3.7.13.

The C function sqlite3_errstr() was introduced in sqlite3 v3.7.15.

My code was calling sqlite3_errstr().

The application was crashing on launch.

Setting libsqlite3.dylib as optional (rather than required) did the job.

1

The few times it happened with me a simple Clean (shift + cmd + K) did the trick.

1

I got some error similar: dyld: Symbol not found: _NSDictionary0 By the link: I reset my related projects' Deployment target to same value: 8.0, then it ok. May be something changed in ios9.0 and ios8.0, so if we want to make 8.0 compatible, we should make the related projects to know.

dyld: Symbol not found: ___NSDictionary0__ when using google ServiceGenerator binary with discovery docs in XCode 7 & iOS target 9.0

1

In my case it happened when I updated 3rd party library using CocoaPods.


Simply Clearing Build Folder helped K

0

Make CFNetwork.framework optional it worked for me

0

In my case I had a framework with the same name as an Apple internal framework named AuthKit. So during run time it was trying to look for a symbol AKAppleIdSession in my AuthKit framework instead of apple's framework. Thus leading to crash with error Symbol not found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.