当我尝试构建项目时,我收到以下错误(见下文)
一些信息
IOS7目标
升级到xcode 7.但我确实遇到了xcode 6中的问题
BaseSdk IOS9
已安装Pod。但由于我的项目针对的是IOS7,我无法使用use_frameworks
代码适用于我的同事机器
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)
答案 0 :(得分:3)
我曾尝试通过拖动行李箱图标来迁移到Fabric。在无法工作之后,我沿着Cocoapods路线更新Crashlytics并将Fabric添加到我的应用程序中。我在这里得到了同样的错误信息。
原来,当我尝试将Fabric拖过时,我保留了单选按钮,将所有项目复制到本地选中 - 当你这样做时,它也复制了一个本地Security.framework
文件。这个版本的Security.framework
被我的目标引用,这显然导致了这个问题,因为它们发生冲突,产生的错误就好像它根本没有被引用一样。
当我从Linked Frameworks and Libraries
中移除此内容并将其从项目中删除并移至废纸篓,然后正确地重新添加Security.framework
时,此错误就消失了。
答案 1 :(得分:2)
将Security.framework添加到User
中的目标并构建
答案 2 :(得分:0)