12

I'm trying to compile some code that makes use of the CFNetwork framework, and it runs just fine in the simulator (with a deployment target of iOS 7.1), however when I attempt to run it on my iPhone 5 running iOS 7.1, it throws the following error:

dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate Referenced from: /var/mobile/Applications/...... Expected in: /System/Library/Frameworks/CFNetwork.framework/CFNetwork in /var/mobile/Applications/...

As for information about my app, it is written in Swift, and I am importing CFNetwork through Parse, which I import into my Swift code via an objective-C bridging header.

I am able to resolve this error, as others have suggested, by making the CFNetwork framework optional rather than required. However, the CFNetwork framework is required for my app to work (I'm using Parse as a backend, and it won't communicate without it).

As such, I am curious if anybody else has been able to resolve this issue by utilizing a method other than the above.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Will Jack
  • 303
  • 3
  • 12
  • I found the answer here that got it to work in my project, might help you. http://stackoverflow.com/questions/24043532/dyld-symbol-not-found-nsurlauthenticationmethodclientcertificate-when-trying – Stuart Campbell Jun 10 '14 at 15:46
  • Thanks for the suggestion, but explicitly adding the Foundation framework didn't work for me. – Will Jack Jun 10 '14 at 21:25
  • Got the same error for an Obj-C app using Xcode 6 Beta, Works great when I switched to Xcode 5. – Alex Spencer Jun 27 '14 at 04:37
  • 1
    I had similar crash on device, please take a look at [this answer](http://stackoverflow.com/a/24345546/2920335), does that help? – vladof81 Jul 09 '14 at 02:14
  • I got it working a while ago, thanks! It was an issue in a Cocoapods file. – Will Jack Jul 09 '14 at 03:45
  • @WillJack, as I'm having the same problem and I'm using CocoaPods could you please tell me how did you fix it? Thanks – Claus Aug 21 '14 at 10:39
  • 1
    @Claus Changing the order of the libraries in the app's "Linked Frameworks and Binaries" tab so that Foundation came before CFNetwork didn't change the order the frameworks were actually imported. In order to change the order, I had to change the order of the imported frameworks in my Pods.xcconfig file's OTHER_LDFLAGS section so that -framework Foundation came before -framework CFNetwork. Sorry for the delayed reply and good luck! – Will Jack Aug 24 '14 at 06:09

1 Answers1

0

I got this error when I was moving an application I made from one computer to another. If you used CMake or something equivalent to generate the project files, then I have a solution: In CMake, instead of selecting XCode as the generator, I switched to Unix Makefiles. Then all I had to do was navigate in terminal to the folder where the make files were generated and type:

$ make
$ sudo make install

This created the application with all of the frameworks and dynamic libraries packaged correctly in my /usr/local/bin folder.

I know that this error is also fixable in XCode, but I spent a lot of time fidgeting with the setting without ever figuring it out. This is my solution for packaging the application; however, I still do all of my editing in XCode.

user3817808
  • 187
  • 1
  • 10