RCTfont+FA5.h 找不到用于 react-native-vector-icons 的文件

RCTfont+FA5.h file not found for react-native-vector-icons

对于react-native-vector-icons RCTfont+FA5.h file not found,我不知道我到底哪里出错了?

我执行的步骤:

1.npm 我 react-native-vector-icons

2.react-native link react-native-vector-icons

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

P.S:我正在使用 cocoapods,我确保我在 ios 文件夹中安装了 运行 pod,并且还使用 .xcworkspace 文件进行构建。

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

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

来自the docs

“注意:--save 或 --save-dev 标志对于此步骤非常重要。React Native 将 link 您的库基于 package.json 文件中的依赖项和 devDependencies。”

所以要修复它,unlink 并删除包..

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

然后再次使用 --save 或 --save-dev 和 link 重新安装。

--save 对我的情况没有帮助。升级到 "react-native-vector-icons": "6.4.1" 为我解决了这个问题

我不得不降级到 "react-native-vector-icons":"6.3.0".

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

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

问题是文件 RCTfont+FA5.mnode_modules/react-native-vector-icons/RNVectorIconsManager 6.4.0 以上的版本

中不存在

我试过 6.3.0 版,但没用

降级到 6.10 并开始工作