如何解决Carthage和Swift版本的错误?

问题描述 投票:0回答:1

我在做carthage update --plaform ios时遇到错误

这是cartfile:

github "Alamofire/Alamofire" ~> 4.4
github "ReactiveX/RxSwift" ~>  4.3.1
github "RxSwiftCommunity/RxAlamofire" ~> 4.4.0
github "onevcat/Kingfisher" ~> 3.0
github "patchthecode/JTAppleCalendar" ~> 7.0
github "stripe/stripe-ios"

和日志错误:

错误:SWIFT_VERSION'5.0'不受支持,支持的版本为:3.0,4.0,4.2。 (目标'RxAlamofire iOS')

我的项目使用Swift 4.2,我检查了RSx的RxAlamofire github项目,它适用于Swift 4.2。

有没有人有同样的问题,知道如何解决它?

swift carthage
1个回答
2
投票

删除RXAlamofire版本,然后重试

github "Alamofire/Alamofire" ~> 4.4
github "ReactiveX/RxSwift" ~>  4.3.1
github "RxSwiftCommunity/RxAlamofire"
github "onevcat/Kingfisher" ~> 3.0
github "patchthecode/JTAppleCalendar" ~> 7.0
github "stripe/stripe-ios"

你也可以删除整个第一行github "Alamofire/Alamofire" ~> 4.4,因为Alamofire是RXAlamofire的依赖,并将自动下载。

个人经验:除非我有理由,否则我通常不指定特定版本。

© www.soinside.com 2019 - 2024. All rights reserved.