dyld:未找到符号:尝试运行 iOS 应用程序时出现 _NSURLAuthenticationMethodClientCertificate
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24043532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate when trying to run iOS app
提问by Jorge
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)
dyld:未找到符号:_NSURLAuthenticationMethodClientCertificate
引用自:/var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS 预期在:/System/Library/Frameworks/CFNetwork inframe. /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.
当我尝试构建和运行时。当我从我的项目中删除 CFNetwork 时,它可以工作,我不知道为什么。
I just installed Xcode6Beta and opened my project. It was working fine on Xcode5.1.
我刚刚安装了 Xcode6Beta 并打开了我的项目。它在 Xcode5.1 上运行良好。
UPDATE:
更新:
It works fine on iOS simulator with Xcode 6, the problem is on my device running iOS 7.1.1.
它在带有 Xcode 6 的 iOS 模拟器上运行良好,问题出在我运行 iOS 7.1.1 的设备上。
UPDATE 2:
更新 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. :)
下面选定的答案对我有用,尽管我已经将基础框架显式添加到我的项目中,但我不得不将其删除并再次添加。问题解决了,至少,目前。:)
回答by plluke
Edited to include two possible steps you need to take:
编辑为包括您需要采取的两个可能的步骤:
- Make sure you have Foundation framework to your project. (Remove and add it again to be sure).
- Make sure the Foundation framework include is beforeCFNetwork.
- 确保你的项目有 Foundation 框架。(删除并再次添加以确保)。
- 确保 Foundation 框架包含在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.
iOS8.0 中的标头包含的内容似乎发生了变化(例如,glextensions 文件不再位于顶部标头中)。如果您明确地将 Foundation 框架添加到您的项目中,它将很好地构建。将 CFNetwork 设为可选当然会导致失败,并且只是构建错误的解决方案,而不是整体解决方案。
回答by Warif Akhand Rishi
I had a similar issue with UIAlertAction
我有一个类似的问题 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/ ...
dyld:找不到符号:_OBJC_CLASS_$_UIAlertAction 引用自:/var/mobile/Applications/ ....app/ ... 预期在:/System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications / ....应用程序/ ...
Making UIKit.frameWork
Optional
solved my issue. In your case I am guessing, making your CFNetwork.framework
optional
will solve your problem too.
制作UIKit.frameWork
Optional
解决了我的问题。在你的情况下,我猜,让你的CFNetwork.framework
optional
意志也解决你的问题。
回答by Graham Perks
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.
在 XCode 中重新排序并没有解决问题;我正在使用 Cocoapods,它创建了一个 Pods.xcconfig 文件。这有一个 OTHER_LDFLAGS 行。我把它-framework Foundation
作为第一个条目,这使我的项目工作。
OTHER_LDFLAGS = -framework Foundation -ObjC …
(Beware, this file gets re-generated each time you pod update
.)
(请注意,每次执行此文件时都会重新生成此文件pod update
。)
回答by Felix Lapalme
Reorder your frameworks to have Foundation before CFNetwork.
将您的框架重新排序以在 CFNetwork 之前拥有 Foundation。
That's a temporary fix to something that is obviously a bug in Xcode 6.
这是对 Xcode 6 中明显存在的错误的临时修复。
回答by user2620092
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.
我在 WWDC 上遇到了这个确切的问题。我与几位 Apple 工程师交谈过,他们告诉我这是由于在 CFNetwork 和 Foundation 之间移动一些符号而导致的 SDK 中的错误,并且它将在下一个版本中解决,很快就会发布。在某些情况下,您可以通过使用导入框架的顺序来解决它,但它并不总是有效。
回答by Nicolas Buquet
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.
我在运行 iOS 8.1.3 的设备上使用 sqlite3 和 Xcode 6.3 时遇到了同样的问题,因此使用 sqlite3 v3.7.13。
The C function sqlite3_errstr() was introduced in sqlite3 v3.7.15.
C 函数 sqlite3_errstr() 是在 sqlite3 v3.7.15 中引入的。
My code was calling sqlite3_errstr().
我的代码正在调用 sqlite3_errstr()。
The application was crashing on launch.
应用程序在启动时崩溃。
Setting libsqlite3.dylib as optional (rather than required) did the job.
将 libsqlite3.dylib 设置为可选(而不是必需)完成了这项工作。
回答by Joseph Junior Sfeir
The few times it happened with me a simple Clean (shift + cmd + K) did the trick.
有几次它发生在我身上,一个简单的 Clean (shift + cmd + K) 就成功了。
回答by Huangzy
I got some error similar: dyld: Symbol not found: _NSDictionary0By 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:找不到符号:_NSDictionary0通过链接:我将相关项目的部署目标重置为相同的值:8.0,然后就可以了。可能是ios9.0和ios8.0有什么变化,所以如果我们要兼容8.0,应该让相关项目知道。
dyld:找不到符号:___NSDictionary0__ 在 XCode 7 和 iOS 目标 9.0 中使用带有发现文档的 google ServiceGenerator 二进制文件时
回答by Robert Dresler
In my case it happened when I updated 3rd party library using CocoaPods.
就我而言,它发生在我使用 CocoaPods 更新 3rd 方库时。
Simply Clearing Build Folder helped ??K
简单地清除构建文件夹有帮助 ??K
回答by Vishal Parihar
Make CFNetwork.framework optional it worked for me
使 CFNetwork.framework 可选它对我有用