Alamofire Swift-2.0分支失败,出现了几个错误

时间:2015-07-30 18:35:33

标签: swift2 alamofire

我有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?'

有什么想法吗?

编辑:添加了屏幕截图,如果它更容易阅读。

enter image description here

1 个答案:

答案 0 :(得分:3)

我们有很多人报告此问题,而且一直是由于配置问题或过时的分支。 Alamofire本身已经解决了潜在的问题,现在我们只需要弄清楚&#34;你的&#34;问题在于。这里列出了您需要正确设置的所有内容。

将CocoaPods更新为最新版本

cnoon:~$ sudo gem install cocoapods
cnoon:~$ pod --version
0.38.2

将xcodebuild指向最新版本

cnoon:~$ xcodebuild -version
Xcode 7.0
Build version 7A165t
  

如果这不是指向Xcode 7 beta 4版本,您可以在Preferences =&gt;下的Xcode 7偏好设置中进行设置。 Locations =&gt; Command Line Tools

重新运行CocoaPods

您可能会在swift-2.0分支上提交一些过时的提交。再次运行pod update以确保从该分支中​​提取任何新提交。

通过正确设置所有这些设置,您应该能够解决问题。如果您仍然遇到问题,请再次发表评论,我会相应地调整我的答案。

相关问题