4

对于未找到 react-native-vector-icons RCTfont+FA5.h文件,我不知道我到底哪里出错了?

我做的步骤:

1.npm 我反应原生矢量图标

2.react-native 链接 react-native-vector-icons

并且在尝试构建时,我不断收到错误“RCTfont+FA5.h”未找到。

PS:我正在使用 cocoapods ,我确保我已经在 ios 文件夹中运行了 pod install 并且还使用 .xcworkspace 文件进行构建。

感谢您花时间阅读并尝试提供帮助。

4

4 回答 4

3

当你在 RN 中使用链接时,你应该使用npm i react-native-vector-icons --saveor npm i react-native-vector-icons --save-dev

文档

“注意:--save 或--save-dev 标志对于这一步非常重要。React Native 将根据 package.json 文件中的依赖项和 devDependencies 链接您的库。”

所以要修复它,取消链接并删除包..

react-native unlink react-native-vector-icons&&npm remove react-native-vector-icons

然后使用 --save 或 --save-dev 重新安装并再次链接。

于 2019-01-30T14:51:46.260 回答
3

--save在我的情况下没有帮助。升级"react-native-vector-icons": "6.4.1"为我解决了它

于 2019-03-14T06:31:10.613 回答
0

我不得不降级到“react-native-vector-icons”:“6.3.0”。

此版本在“node_modules/react-native-vector-icons/RNVectorIconsManager”中有“RCTFont+FA5.h”(与“6.4.1”相对)。

然后我从 pod 文件中删除了该条目,并在 Xcode 中手动添加了项目。

在此处输入图像描述

于 2019-04-25T16:54:21.080 回答
0

问题是6.4.0 及以后版本RCTfont+FA5.m中不存在该文件node_modules/react-native-vector-icons/RNVectorIconsManager

我尝试使用 6.3.0 版,dd'nt 工作

降级到 6.10 及其工作

于 2019-04-30T12:01:21.020 回答