12
votes

I have added all AFNetworking library files to my project(Which I downloaded from github). I didn't created any other view controller/class etc in my application. I just built my application and found 9 errors "Undefined symbols for architecture". Any help would be appreciated.

I listed down the list of errors.

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", referenced from:-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o

ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

4
did you include the SystemConfiguration, Security and MobileCoreService Frameworks?CarlJ
I think you need to add SystemConfiguration.Framework in you iOS projectBuntylm
Just add the Security FrameworkSaify
I have just Added Security and MobileCoreService Frameworks, My application is working fine now. A big thanx friend.Aaban Tariq Murtaza
You should accept the question that solved your problem.Matt Wolfe

4 Answers

11
votes

I think you need to add Security.framework in you iOS project.

enter image description here

enter image description here

4
votes

Include the "Security" Framework. Everything works fine then.

Cheers!!

4
votes

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
2
votes

If you are adding the files of AFNetworking in your project then make sure that AFNetworking.m is selected for the target memebership of your project.

You could fix it by opening your AFNetworking.m file and in file inspector just tick the target membership for your project target.

Also make sure to include all the relevant frameworks in your project in order to make AFNetworking working. i.e, systemConfiguration, security frameworks.