문제

I added AFNetworking 2.0 to my project. I did it without the use CocoaPods - I just added the files to the project, making sure to copy the files to target.

When I try to compile the project I get the following error:

Undefined symbols for architecture i386:
  "_SecCertificateCopyData", referenced from:
      _AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecCertificateCreateWithData", referenced from:
      _AFPublicKeyForCertificate in AFSecurityPolicy.o
  "_SecPolicyCreateBasicX509", referenced from:
      _AFPublicKeyForCertificate in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecTrustCopyPublicKey", referenced from:
      _AFPublicKeyForCertificate in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecTrustCreateWithCertificates", referenced from:
      _AFPublicKeyForCertificate in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecTrustEvaluate", referenced from:
      _AFPublicKeyForCertificate in AFSecurityPolicy.o
      _AFServerTrustIsValid in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecTrustGetCertificateAtIndex", referenced from:
      _AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
  "_SecTrustGetCertificateCount", referenced from:
      _AFCertificateTrustChainForServerTrust in AFSecurityPolicy.o
      _AFPublicKeyTrustChainForServerTrust in AFSecurityPolicy.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What is wrong with my project?

도움이 되었습니까?

해결책

Your missing iOS frameworks in the project. I bet security framework is one of them from the names I see.

다른 팁

#import <Security/Security.h> in your PCH file + make sure the library is in "Link Binary With Libraries".

Just add security.framework in your project.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top