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

标签 ios react-native react-native-vector-icons

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

我做的步骤:

1.npm i react-native-vector-icons

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

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

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

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

最佳答案

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

来自 the docs

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

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

react-native 取消链接 react-native-vector-icons && npm remove react-native-vector-icons

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

关于ios - 找不到用于 react-native-vector-icons 的 RCTfont+FA5.h 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54443198/

相关文章:

javascript - 如何在 native react 中进行回调

react-native - 将自定义图标导入 React Native 0.62

ios - 无法构建事件方案

ios - 尝试使用 Swift 实现无限滚动时陷入无限循环

react-native - 未定义不是对象(评估 '_reactNativeCamer.RNCamera.Constants'

javascript - 如何升级到React Native 0.57.0版本?

ios - 节点模块/react-native-vector-icons/lib/create-icon-set.js : #<WeakSet> could not be cloned

android - react-native-vector-icons/羽毛图标不显示

ios - 如果我想为 UIButton 创建更大的点击区域,我应该覆盖 hitTest : or pointInside:?

objective-c - NSSortDescriptor 具有名字和姓氏,或者具有名字或姓氏?