12

我已将所有 AFNetworking 库文件添加到我的项目中(我从 github 下载的)。我没有在我的应用程序中创建任何其他视图控制器/类等。我刚刚构建了我的应用程序,发现了 9 个错误“未定义的架构符号”。任何帮助,将不胜感激。

我列出了错误列表。

Undefined symbols for architecture i386:

"_SecCertificateCopyData", referenced from:
-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o

"_SecCertificateCreateWithData", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o

"_SecPolicyCreateBasicX509", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o  "_SecTrustCopyPublicKey", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o  "_SecTrustCreateWithCertificates", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o "_SecTrustEvaluate", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o  "_SecTrustGetCertificateAtIndex", referenced from:-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o

“_SecTrustGetCertificateCount”,引用自:-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o

ld:未找到体系结构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

4

4 回答 4

11

我认为您需要添加Security.framework您的 iOS 项目。

在此处输入图像描述

在此处输入图像描述

于 2013-10-07T13:13:14.687 回答
4

I was also facing the same problem but now I have found my fault. Do check following frameworks are added if you are facing similar problem

  1. Security.framework
  2. SystemConfiguration.framework
  3. MobileCoreServices.framework
于 2014-10-30T05:33:21.180 回答
4

包括“安全”框架。那时一切正常。

干杯!!

于 2013-10-07T13:10:30.160 回答
2

如果您要在项目中添加 AFNetworking 文件,请确保AFNetworking.m选择该文件作为项目的目标成员。

您可以通过打开 AFNetworking.m 文件来修复它,并在文件检查器中勾选项目目标的目标成员资格。

还要确保在您的项目中包含所有相关框架,以使 AFNetworking 正常工作。即系统配置、安全框架。

于 2013-10-07T13:08:18.243 回答