dyld: Symbol not found: _NSURLAuthenticationMethod

2020-01-24 21:08发布

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

10条回答
我只想做你的唯一
2楼-- · 2020-01-24 21:10

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

查看更多
男人必须洒脱
3楼-- · 2020-01-24 21:13

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

查看更多
虎瘦雄心在
4楼-- · 2020-01-24 21:13

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.

查看更多
干净又极端
5楼-- · 2020-01-24 21:13

Make CFNetwork.framework optional it worked for me

查看更多
贪生不怕死
6楼-- · 2020-01-24 21:15

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

查看更多
贪生不怕死
7楼-- · 2020-01-24 21:24

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.

查看更多
登录 后发表回答