Xcode 7 error. Missing required architechture when building

When I try to build my project I get the following errors (see below)

Some info

IOS7 target

Upgraded to xcode 7. But I did experience issues in xcode 6 also

BaseSdk IOS9

Pods installed. But since my project is targeting IOS7 I can't use use_frameworks

The code works on my colleagues machine

ld: warning: ignoring file /Users/jvk/Code/*****/Security.framework/Security, missing required architecture x86_64 in file /Users/jvk/Code/****/Security.framework/Security (3 slices)
Undefined symbols for architecture x86_64:
  "_SecCertificateCopyData", referenced from:
      _AFCertificateTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecCertificateCreateWithData", referenced from:
      +[FABCertificatePinner createCertificationWithData:length:] in Fabric(FABCertificatePinner.o)
      _AFPublicKeyForCertificate in libPods.a(AFSecurityPolicy.o)
      -[AFSecurityPolicy evaluateServerTrust:forDomain:] in libPods.a(AFSecurityPolicy.o)
      _FABCertificateWithData in Fabric(FABCerts.o)
  "_SecPolicyCreateBasicX509", referenced from:
      _AFPublicKeyForCertificate in libPods.a(AFSecurityPolicy.o)
      -[AFSecurityPolicy evaluateServerTrust:forDomain:] in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecPolicyCreateSSL", referenced from:
      -[AFSecurityPolicy evaluateServerTrust:forDomain:] in libPods.a(AFSecurityPolicy.o)
  "_SecTrustCopyPublicKey", referenced from:
      _AFPublicKeyForCertificate in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecTrustCreateWithCertificates", referenced from:
      _AFPublicKeyForCertificate in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecTrustEvaluate", referenced from:
      -[FABCertificatePinner evaluateTrust:result:] in Fabric(FABCertificatePinner.o)
      _AFPublicKeyForCertificate in libPods.a(AFSecurityPolicy.o)
      _AFServerTrustIsValid in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecTrustGetCertificateAtIndex", referenced from:
      _AFCertificateTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecTrustGetCertificateCount", referenced from:
      _AFCertificateTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
      _AFPublicKeyTrustChainForServerTrust in libPods.a(AFSecurityPolicy.o)
  "_SecTrustSetAnchorCertificates", referenced from:
      -[FABCertificatePinner evaluateTrust:result:] in Fabric(FABCertificatePinner.o)
      -[AFSecurityPolicy evaluateServerTrust:forDomain:] in libPods.a(AFSecurityPolicy.o)
  "_SecTrustSetAnchorCertificatesOnly", referenced from:
      -[FABCertificatePinner evaluateTrust:result:] in Fabric(FABCertificatePinner.o)
  "_SecTrustSetPolicies", referenced from:
      -[AFSecurityPolicy evaluateServerTrust:forDomain:] in libPods.a(AFSecurityPolicy.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Upvotes: 2

Views: 1436

Answers (3)

Breeno
Breeno

Reputation: 3166

I had tried migrating to Fabric by dragging the suitcase icon across as they suggested. After this failed to work, I went down the Cocoapods route for updating Crashlytics and adding Fabric to my app. I was getting the same error message here.

Turned out, when I attempted to drag Fabric across earlier, I kept the radio button for copying all items to local selected - when you do this, it copies a local Security.framework file across too. It was this version of Security.framework being referenced by my target, which apparently causes this issue as they conflict, which produces the same error as if it wasn't referenced at all.

When I removed this from Linked Frameworks and Libraries, and deleted it from the project and moved to trash, then re-added Security.framework properly, this error went away.

Upvotes: 3

abintom
abintom

Reputation: 1028

Add the Security.framework to your target in Link Binary with Libraries and build

Upvotes: 2

Imran
Imran

Reputation: 2941

Try adding x86_64 as an architecture to build for and set it to always build for all architectures. enter image description here

Upvotes: 0

Related Questions