“无法确定以下 Pod 的 Swift 版本” - 错误

Nik*_*til 16 objective-c ios cocoapods

我正在尝试安装pod 'SVProgressHUD'可可豆荚,但在安装豆荚文件时出现以下错误。

[!] Unable to determine Swift version for the following pods:

- `HexColors` does not specify a Swift version and none of the targets (`FaveoHelpdeskPro_ObjC`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
Run Code Online (Sandbox Code Playgroud)

错误截图

我该如何解决这个问题?

Bog*_*yak 53

尝试通过包含来设置 Swift 版本

ENV['SWIFT_VERSION'] = '5' 在 Podfile 的顶部。


La *_* Ko 10

这是因为你的项目很老并且从未在项目中设置Swift版本。尝试在项目中创建一个新的 swift 文件。Xcode 会在项目构建设置中自动设置 Swift 版本。然后pod install再重来就可以解决了。