过去两天我一直在构建我的项目,但今天早上我打开了这个项目并尝试构建它并得到了错误
无法识别的平台名称 iOS
,代码如下。
if (@available(iOS 9.0, *)) {
if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
diff = diff * -1;
}
}
错误来 self 的 pod 中的一个项目:https://github.com/airbnb/lottie-ios
最佳答案
我今天在 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,因为此代码已插入到最新版本中。
关于ios - Lotti 中无法识别的平台名称 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47037713/