如何在Xcode 10.1中添加Alamofire

时间:2019-04-17 17:03:47

标签: ios cocoapods alamofire

使用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

3 个答案:

答案 0 :(得分:5)

Swift 5中添加了对XCode

version 10.2支持。要将AlamofireSwift 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