【发布时间】:2018-11-13 01:31:48
【问题描述】:
我尝试链接 lottie-ios,但出现编译错误。 Lottie 在安卓模拟器上运行良好。
这是我所做的: 1. npm i --save lottie-react-native@2.3.2 2. react-native 链接 lottie-ios 3. react-native 链接 lottie-react-native 4. 之后,打开 Xcode 项目配置并将 Lottie.framework 添加为 Embedded Binaries
我有多个从这个开始的编译错误:
/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 版本:
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
提前谢谢你。
【问题讨论】:
-
不要使用 react-native 链接。在大多数情况下它不起作用。使用手动链接facebook.github.io/react-native/docs/linking-libraries-ios
标签: ios react-native lottie