Lottie-react-native 不基于 iOS 12 RN 0.60.4
Lottie-react-native not building on iOS 12 RN 0.60.4
尝试将 Lottie 添加到我的本机反应应用程序中,但它不断抛出错误。
我遵循的步骤基于原始 github 和我在互联网上找到的帖子:
(顺便说一句,我不使用 Cocoapods)
- 由
yarn add lottie-react-native
和 yarn add
lottie-ios@3.0.3
安装。
- 手动链接它们,因为出于某种原因我
自动链接不起作用(我认为这是一个问题,因为我从
0.59 到 0.60.4 或者我不知道它应该如何工作)。
- 在我的项目中将
LottieReactNative.xcodeproj
和 Lottie.xcodeproj
添加到 /Libraries 中。
- 将
libLottie.a
和 libLottieReactNative.a
添加到 Link 二进制库 。
- 将
Lottie.framework
添加到我的目标的 嵌入框架 。
- 不知道为什么 Target 里面有一个 Lottie_iOS (Lottie)
依赖项,尝试删除它但它抛出一个错误说
"Cannot find module Lottie" 在一些 React Native Lottie 文件上。所以我
把它加回去。
- 添加了标志 LD_VERIFY_BITCODE 并设置为 "NO"。取自
一些计算器。
- 此外,转到 XCode 的 项目设置 和
将 构建系统 更改为
Legacy Build System
.
到目前为止似乎没有任何效果。
版本:
"react": "16.8.6",
"react-native": "^0.60.4",
"lottie-ios": "^3.0.3",
"lottie-react-native": "^3.1.0",
构建失败时抛出的错误是:
Showing Recent Messages
Build target LottieLibraryIOS of project Lottie with configuration Debug
<unknown>:0: error: filename "TextCompositionLayer.swift" used twice: '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
对正在发生的事情有什么想法吗?
问题出在您的手动链接上。新的自动链接过程正在使用 Cocoapods。如果可能,请使用 react-native init
创建新项目并将项目导入新模板或使用 Upgrade Helper 升级现有项目模板。
尝试将 Lottie 添加到我的本机反应应用程序中,但它不断抛出错误。 我遵循的步骤基于原始 github 和我在互联网上找到的帖子:
(顺便说一句,我不使用 Cocoapods)
- 由
yarn add lottie-react-native
和yarn add lottie-ios@3.0.3
安装。 - 手动链接它们,因为出于某种原因我 自动链接不起作用(我认为这是一个问题,因为我从 0.59 到 0.60.4 或者我不知道它应该如何工作)。
- 在我的项目中将
LottieReactNative.xcodeproj
和Lottie.xcodeproj
添加到 /Libraries 中。 - 将
libLottie.a
和libLottieReactNative.a
添加到 Link 二进制库 。 - 将
Lottie.framework
添加到我的目标的 嵌入框架 。 - 不知道为什么 Target 里面有一个 Lottie_iOS (Lottie) 依赖项,尝试删除它但它抛出一个错误说 "Cannot find module Lottie" 在一些 React Native Lottie 文件上。所以我 把它加回去。
- 添加了标志 LD_VERIFY_BITCODE 并设置为 "NO"。取自 一些计算器。
- 此外,转到 XCode 的 项目设置 和
将 构建系统 更改为
Legacy Build System
.
到目前为止似乎没有任何效果。 版本:
"react": "16.8.6",
"react-native": "^0.60.4",
"lottie-ios": "^3.0.3",
"lottie-react-native": "^3.1.0",
构建失败时抛出的错误是:
Showing Recent Messages
Build target LottieLibraryIOS of project Lottie with configuration Debug
<unknown>:0: error: filename "TextCompositionLayer.swift" used twice: '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
对正在发生的事情有什么想法吗?
问题出在您的手动链接上。新的自动链接过程正在使用 Cocoapods。如果可能,请使用 react-native init
创建新项目并将项目导入新模板或使用 Upgrade Helper 升级现有项目模板。