我试图链接lottie-ios,但是我有一个编译错误。Lottie在android仿真器中工作得很好。
以下是我所做的工作: 1. npm i--保存lottie-react-本机@2.3.2. Here本机链接lottie-ios 3. react本机链接lottie-react原生4.打开Xcode项目配置,并将Lottie.framework添加为嵌入式二进制文件
我有多个编译错误,从这个开始:
/Users/user/Code/CSULB/CECS_543/anacodiam_ios/node_modules/lottie-react-native/src/ios/../../../react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: fatal error: "limits" file not found
#include <limits>
While building module "UIKit" imported from /Users/user/Code/CSULB/CECS_543/anacodiam_ios/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTViewManager.h:8:
While building module "Foundation" imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
In file included from <module-includes>:1: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module "CoreFoundation"
#include <CoreFoundation/CoreFoundation.h>
我的反应-本土化版本:
react-native -V
0.57.4
屏幕截图这里是我的项目设置(文件>项目设置):https://imgur.com/MgyNqDj
我的一般设置:https://imgur.com/HoghSUA
我的头搜索路径:https://imgur.com/Hd5ngHh
我按照这个问题的要求添加了$(SRCROOT)/../node_modules/react-native/React/
,Github
和我的构建阶段:https://imgur.com/cg630rS
提前谢谢你。
发布于 2018-11-13 10:12:07
正如Anhtu所说,lottie的自动链接可能会中断。另外,我也遇到了同样的编译问题:您应该将lottie-react-native
更新为最新版本(目前为2.5.9),他们修复了他们的iOS项目header search path
设置。
在2.5.8版本中,他们的项目使用递归选项引用React
文件夹,这会导致CodeFoundation构建错误。(这曾经是ReactNative推荐的,但从:https://facebook.github.io/react-native/docs/linking-libraries-ios开始就改变了)他们从2.5.9开始就删除了这个header search path
,现在这个CoreFoundation错误已经消失了!
https://stackoverflow.com/questions/53272484
复制相似问题