dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate when trying to run iOS app

53,218

Solution 1

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

Solution 2

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

Solution 3

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.)

Solution 4

Reorder your frameworks to have Foundation before CFNetwork.

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

Solution 5

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.

Share:
53,218
Jorge
Author by

Jorge

Updated on July 09, 2022

Comments

  • Jorge
    Jorge almost 2 years

    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. :)

  • Jorge
    Jorge almost 10 years
    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?
  • Warif Akhand Rishi
    Warif Akhand Rishi almost 10 years
    @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.
  • Warif Akhand Rishi
    Warif Akhand Rishi almost 10 years
    @Jorge btw does it still crash after making the framework optional?
  • Jorge
    Jorge almost 10 years
    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.
  • plluke
    plluke almost 10 years
    @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.
  • Hari Ganesan
    Hari Ganesan almost 10 years
    Just changed CFNetwork to optional, figured I should check online, and then saw your post. Thanks for saving me some future headaches...
  • Felix Lapalme
    Felix Lapalme almost 10 years
    @dasblinkenlight i just edited my answer for something that really works. Thanks
  • Graham Perks
    Graham Perks almost 10 years
    Thanks for the info. FWIW, I'm still seeing the error in beta 2.
  • Gary Makin
    Gary Makin almost 10 years
    For convenience, it was sufficient for me just to uncheck the Target membership checkbox for Foundation.framework and check it again.
  • João Nunes
    João Nunes almost 10 years
    Actually this do not solve the problem! what solves is the other answer from Lap.felix: Reorder your frameworks to have Foundation before CFNetwork.
  • plluke
    plluke almost 10 years
    @JoãoNunes Thanks for the clarification. For me I didn't have foundation at all, which was the problem/change I could see in iOS8. If you already had foundation added then, yes, it will need to precede CFNetwork in order for the new include to make a difference.
  • João Nunes
    João Nunes almost 10 years
    @plluke I would update your answer and mention that due to a bug(mentioned also in one answer) you need to reorder the Frameworks.
  • sandy
    sandy almost 10 years
    @plluke I'm facing same problem, and I'm not using CFNetwork.framework in my project. if I imported it and make it option then project run but not able to fetch data from server, its not crash but stop on splash screen and not enter into home screen. can any one please help me on this........
  • Jayprakash Dubey
    Jayprakash Dubey almost 10 years
    This worked for me. Does the sequence of adding Framework matters?
  • plluke
    plluke almost 10 years
    @JayprakashDubey It does seem to in certain situations. Honestly I'm hoping this to be fixed by the time iOS8/Xcode6 goes GM so I see this as a temporary workaround. If this still persists as we get closer to GM then I'd probably dig deeper into the exact root cause.
  • meda
    meda over 9 years
    Thanks a lot, all I had to do is drag foundation above CFNetwork and voila, I added a screenshot.
  • Ruben Martinez Jr.
    Ruben Martinez Jr. over 9 years
    Issue still present in Beta 5, just FYI
  • Claus
    Claus over 9 years
    I can confirm it works and the order really matters. Drag Foundation.framework on top of CFNetwork.framework to do the trick!
  • Nickolas
    Nickolas over 9 years
    thanks, it take me out. Cocoapods configuration overwrite the xcode. This is the solution for cocoapoders.