使用CocaPods添加Alamofire后,编译应用程序时出现以下错误。
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'Alamofire')
Podfile:pod 'Alamofire', '~> 5.0.0-beta.5'
我正在关注link,将Alamofire添加到我的Swift 5
项目中
Xcode Version: 10.1
答案 0 :(得分:5)
Swift 5
中添加了对XCode
的 version 10.2
支持。要将Alamofire
与Swift 5
一起使用,您需要更新XCode
的版本。其他建议是在窗格设置中将Alamofire
的版本降级为4.8.2
或将Swift
的版本更改为4.2
。
答案 1 :(得分:1)
Swift 5
中的 XCode 10.2
版本支持。您不能在XCode 10.1
中使用 Alamofire 的测试版。要在 XCode 10.1 版本中使用 Alamofire ,您只需使用
pod 'Alamofire'
代替
pod 'Alamofire', '~> 5.0.0-beta.5'
希望这会有所帮助。
答案 2 :(得分:1)
将Xcode更新到10.2或下载支持Swift 5.0的最新Xcode。最好保持更新,而不是使用任何库的最新版本到旧的Xcode版本。从Xcode 10.2开始,它支持Swift 5