对于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 --save
或 npm 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/