ios - Lotti 中无法识别的平台名称 iOS

标签 ios lottie

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

无法识别的平台名称 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/

相关文章:

javascript - Lottie Events 和 Lottie EventListeners 有什么区别以及如何使用?

vue.js - 类型错误 : Cannot read properties of undefined (reading 'length' ) when using vue-lottie

ios 核心数据谓词搜索相似词

ios - Xcode 中的设备方向似乎无法正常工作

iphone - 如何创建自定义 UIDatePicker 控件

javascript - 使用按钮启动和停止乐透播放器/动画

react-native - 类型错误 : undefined is not an object (evaluating 'subscription[nativeEmitterSubscriptionKey]' ) when using animated spinner

ios - 是否可以使用Typhoon框架注入(inject)NSManagedObject实例?

ios - 如何获取当前 EST 时间 IOS Swift

android - Lottie Animation setAnimation() 结果 IllegalStateException