我有Xcode7-beta4,这是我的Podfile的相关部分:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
我的构建失败,出现以下错误:
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:125:30: Cannot invoke 'append' with an argument list of type '(Unmanaged<SecCertificate>)'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:167:13: Cannot invoke 'SecTrustSetPolicies' with an argument list of type '(SecTrust, [Unmanaged<SecPolicy>!])'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:173:17: Cannot invoke 'SecTrustSetPolicies' with an argument list of type '(SecTrust, [Unmanaged<SecPolicy>!])'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:204:17: Cannot invoke 'SecTrustSetPolicies' with an argument list of type '(SecTrust, [Unmanaged<SecPolicy>!])'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:253:30: Cannot invoke 'append' with an argument list of type '(Unmanaged<SecCertificate>)'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:261:62: 'Unmanaged<CFData>!' is not convertible to 'NSData'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:272:29: Cannot invoke 'publicKeyForCertificate' with an argument list of type '(Unmanaged<SecCertificate>)'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:286:35: Cannot invoke 'SecTrustCreateWithCertificates' with an argument list of type '(SecCertificate, Unmanaged<SecPolicy>!, inout SecTrust?)'
/Users/Teja/Projects/Work/CareNarrative/Pods/Alamofire/Source/ServerTrustPolicy.swift:289:25: Cannot assign a value of type 'Unmanaged<SecKey>!' to a value of type 'SecKey?'
有什么想法吗?
编辑:添加了屏幕截图,如果它更容易阅读。
答案 0 :(得分:3)
我们有很多人报告此问题,而且一直是由于配置问题或过时的分支。 Alamofire本身已经解决了潜在的问题,现在我们只需要弄清楚&#34;你的&#34;问题在于。这里列出了您需要正确设置的所有内容。
cnoon:~$ sudo gem install cocoapods
cnoon:~$ pod --version
0.38.2
cnoon:~$ xcodebuild -version
Xcode 7.0
Build version 7A165t
如果这不是指向Xcode 7 beta 4版本,您可以在
Preferences
=&gt;下的Xcode 7偏好设置中进行设置。Locations
=&gt;Command Line Tools
。
您可能会在swift-2.0
分支上提交一些过时的提交。再次运行pod update
以确保从该分支中提取任何新提交。
通过正确设置所有这些设置,您应该能够解决问题。如果您仍然遇到问题,请再次发表评论,我会相应地调整我的答案。