【问题标题】:'Unable to determine Swift version for the following pod" - Error“无法确定以下 pod 的 Swift 版本” - 错误
【发布时间】:2019-11-04 10:19:01
【问题描述】:

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

[!] 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.

我该如何解决这个问题?

【问题讨论】:

  • 联系作者或设置SWIFT_VERSION属性。

标签: ios objective-c cocoapods


【解决方案1】:

尝试通过包含设置 Swift 版本

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

【讨论】:

  • 这解决了原来的问题,但问题并没有完全解决。现在我收到此错误:fatal error: 'hexcolor/hexcolor-Swift.h' file not found
  • @Shajeel Afazl 我也是!
【解决方案2】:

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

【讨论】:

  • 票数最高的解决方案产生了其他错误.. 这个解决方案修复了 stripe-react-native sdk 的 SWIFT_VERSION 问题,没有以下问题
猜你喜欢
  • 2019-11-05
  • 1970-01-01
  • 2018-12-09
  • 2021-05-31
  • 1970-01-01
  • 1970-01-01
  • 2023-02-20
  • 2017-04-13
  • 2020-03-18
相关资源
最近更新 更多