Alamofire Swift-2.0 分支失败并出现多个错误
Alamofire Swift-2.0 branch fails with several errors
我有 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?'
有什么想法吗?
编辑:添加屏幕截图,以使其更易于阅读。
我们已经有很多人报告了这个问题,它总是由于配置问题或过时的分支引起的。 Alamofire 本身已经解决了潜在的问题,现在我们只需要找出 "your" 问题所在。这是您需要正确设置的所有内容的列表。
将 CocoaPods 更新到最新版本
cnoon:~$ sudo gem install cocoapods
cnoon:~$ pod --version
0.38.2
将 xcodebuild 指向最新版本
cnoon:~$ xcodebuild -version
Xcode 7.0
Build version 7A165t
If this isn't pointing at the Xcode 7 beta 4 version, you can set that in the Xcode 7 preferences under Preferences
=> Locations
=> Command Line Tools
.
Re-运行 CocoaPods
您在 swift-2.0
分支上的一些提交可能已过时。 运行 pod update
再次确保您从该分支中提取任何新提交。
通过正确设置所有这些设置,您应该能够解决您的问题。如果您仍然有问题,请再次评论,我会相应地调整我的答案。
我有 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?'
有什么想法吗?
编辑:添加屏幕截图,以使其更易于阅读。
我们已经有很多人报告了这个问题,它总是由于配置问题或过时的分支引起的。 Alamofire 本身已经解决了潜在的问题,现在我们只需要找出 "your" 问题所在。这是您需要正确设置的所有内容的列表。
将 CocoaPods 更新到最新版本
cnoon:~$ sudo gem install cocoapods
cnoon:~$ pod --version
0.38.2
将 xcodebuild 指向最新版本
cnoon:~$ xcodebuild -version
Xcode 7.0
Build version 7A165t
If this isn't pointing at the Xcode 7 beta 4 version, you can set that in the Xcode 7 preferences under
Preferences
=>Locations
=>Command Line Tools
.
Re-运行 CocoaPods
您在 swift-2.0
分支上的一些提交可能已过时。 运行 pod update
再次确保您从该分支中提取任何新提交。
通过正确设置所有这些设置,您应该能够解决您的问题。如果您仍然有问题,请再次评论,我会相应地调整我的答案。