【问题标题】:'React/RCTConvert.h' file not found找不到“反应/RCTConvert.h”文件
【发布时间】:2018-11-14 14:22:37
【问题描述】:

我们正在尝试将 react-native-navigation 安装到 Expo 31 弹出的应用程序中。我们关注了the instructions,但我们遇到了这个问题:

更多详情here.

【问题讨论】:

    标签: react-native expo react-native-navigation


    【解决方案1】:

    进入 (Project Name) -> Build Settings -> Search Paths -> Header Search Paths 并添加文件所在的目录。如果您仍然遇到错误,请确保它也在 Build Phases 中设置-> 将二进制文件与库链接。 Xcode 只是还不知道去哪里寻找那个文件。

    【讨论】:

      【解决方案2】:

      TLDR:我将此添加到我的 Podfile。

       pod 'React',
      :path => "../node_modules/react-native",
      :subspecs => [
        "Core",
        "ART",
        "RCTActionSheet",
        "RCTAnimation",
        "RCTCameraRoll",
        "RCTGeolocation",
        "RCTImage",
        "RCTNetwork",
        "RCTText",
        "RCTVibration",
        "RCTWebSocket",
        "DevSupport",
        "CxxBridge"
      ]
      
      
      pod 'yoga',
          :path => "../node_modules/react-native/ReactCommon/yoga"
      pod 'DoubleConversion',
          :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
          :inhibit_warnings => true
      pod 'Folly',
          :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
          :inhibit_warnings => true
      pod 'glog',
          :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
          :inhibit_warnings => true
      

      长答案:

      去年大部分时间我都遇到了这个问题,我一直在努力寻找一个好的解决方案。不过我觉得这个可行。

      问题是找不到该文件。

      我首先尝试如下重定向路径:

      #import <React/{wherever the folder that file was located in}/FILE.h>
      

      我发现这是一个无限循环。改变的太多了。过了一会儿,我认为问题出在我的 Podfile 上。如果未找到导入,则说明导入或链接可能存在问题 - 因此是 Podfile。

      RN Docs troubleshooting section 中提到

      如果您使用的是 CocoaPods,请确认您已将 React 与子规范一起添加到 Podfile。

      不确定要包括哪些,我在世博论坛上找到了一些帮助。

      https://forums.expo.io/t/upgrading-to-sdk-26-pod-install-issue/8294

      这个问题花了我一周的时间,所以我真的希望你们中的一些人能够使用它。感谢阅读!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-05
        • 1970-01-01
        • 1970-01-01
        • 2022-01-24
        • 2017-08-03
        • 2019-07-03
        相关资源
        最近更新 更多