1

在过去的两天里,我一直在构建我的项目,然后我今天早上打开了这个项目并尝试构建它并得到了错误

Unrecognized platform name iOS使用以下代码。

  if (@available(iOS 9.0, *)) {
  if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
      diff = diff * -1;
  }
}

错误来自我的 pod 中的一个项目:https ://github.com/airbnb/lottie-ios

4

2 回答 2

1

我今天在 Xcode 8.3.3 上使用 pod 版本 2.1.4 时遇到了同样的问题。这个版本(2.1.4)在 Xcode 9.1 上运行良好。这是因为:

有错误的行

if (@available(iOS 9.0, *))

正在使用 @available 编译器标志,根据https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html仅在 Xcode 9 中可用

因此,要么升级到 Xcode 9,要么将 pod 版本降级到 2.1.3,因为此代码已插入到最新版本中。

于 2017-10-31T18:51:58.747 回答
0

我有 pod 版本 1.7.0.beta.3 并且仍然显示该错误,但最好的解决方案是@"String"代码将是:

if(@"available(iOS 9.0, *)")
于 2019-04-29T20:40:30.020 回答