AFNetworking“架构i386的未定义符号”错误

时间:2013-10-07 13:06:28

标签: ios iphone objective-c

我已将所有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.o中的[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:]

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

4 个答案:

答案 0 :(得分:11)

我认为您需要在iOS项目中添加Security.framework

enter image description here

enter image description here

答案 1 :(得分:4)

包括"安全"框架。一切都很好。

干杯!!

答案 2 :(得分:4)

我也遇到了同样的问题,但现在我发现了自己的错。 如果您遇到类似问题,请检查以下框架是否已添加

  1. Security.framework
  2. SystemConfiguration.framework
  3. MobileCoreServices.framework

答案 3 :(得分:2)

如果要在项目中添加AFNetworking的文件,请确保为项目的目标会员选择了AFNetworking.m

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

还要确保在项目中包含所有相关框架,以使AFNetworking正常运行。 即systemConfiguration,安全框架。