react-native 嵌入原生 提示<React/RCTRootView.h> file not found

1.使用react-native 嵌入现有应用程序,使用cocopods导入React组件,但是在使用react-native-video时在react-native link react-native-video 加载到原生后在RCTVideo.h中提示找不到<React/RCTRootView.h>以及其他组件

配置步骤:

i)cocopods导入React组件
    pod 'React', :path => '../node_modules/react-native',         :subspecs => [
        'Core',
        'DevSupport', # 如果RN版本 >= 0.43,则需要加入此行才能开启开发者菜单
        'RCTText',
        'RCTNetwork',
        'RCTWebSocket', # 这个模块是用于调试功能的
    'RCTImage',
        # 在这里继续添加你所需要的模块
  ]
  # 如果你的RN版本 >= 0.42.0,则加入下面这行
  pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
ii)npm install react-native-video --save
iii)react-native link react-native-video

2.项目文件结构

图片描述

图片描述

阅读 5.2k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题