【问题标题】:RCTfont+FA5.h file not found for react-native-vector-icons找不到 react-native-vector-icons 的 RCTfont+FA5.h 文件
【发布时间】:2019-01-30 14:44:55
【问题描述】:

对于 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 文件进行构建。

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

【问题讨论】:

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


    【解决方案1】:

    在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 unlink react-native-vector-icons && npm remove react-native-vector-icons

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

    【讨论】:

    • 哦!谢谢我完全错过了确切的步骤,即没有使用--save。 Soo,现在说我已经安装了 react-native-vector-icons,@stever 的解决方案是什么?
    • 在重试之前使用删除和取消链接的步骤编辑了答案。
    • 不错!一定会喜欢那些解决 Xcode 错误的简单方法!
    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

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

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

      【讨论】:

        【解决方案4】:

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

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

        降级到 6.10 及其工作

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2016-05-27
          • 1970-01-01
          • 2022-10-05
          • 1970-01-01
          • 2017-09-16
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多