ios - 集成现有应用程序 iOS 'React/RCTEventDispatcher.h' 在 React Native 上找不到文件

标签 ios react-native

我正在尝试将 Obj-C 制作的现有应用程序与 React Native 集成。当我不使用任何外部库时,它会成功构建,但是当我尝试与 https://github.com/futurice/react-native-audio-toolkit 集成时(或任何其他库)它给了我这个错误:

'React/RCTEventDispatcher.h' file not found

编辑:

出于某种原因,可以通过更改导入来修复它:

<React/RCTEventDispatcher.h>

致:

"RCTEventDispatcher.h"

最佳答案

1- 从我的 iPhone 模拟器中删除该应用程序,然后转到“硬件”->“删除所有内容和设置”。

2-删除 iOS Podfile 中所有链接的依赖文件 (pod 'xxxxxx', :path => '../node_modules/xxxxx)

3-关闭 Xcode,通过在 iOS 文件夹中写入“pod update”来更新 pod,然后运行“react-native link”。

4- 打开 Xcode 并转到菜单 -> 产品 -> 清理构建文件夹,然后在 Xcode 中运行应用程序。

5-手动将“react-native-gesture-handler”链接到您的 Xcode

6-从 Xcode 运行您的应用

关于ios - 集成现有应用程序 iOS 'React/RCTEventDispatcher.h' 在 React Native 上找不到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42204295/

相关文章:

javascript - 在 react native 的文本框中显示日期选择器

ios - 未找到团队 "XXX"具有 AppStore 连接访问权限的帐户

javascript - React Native 的选择器元素项无效 [在 iOS 中运行]

ios - 将 JSON 解析为字典,判断真假

iOS 论坛设置

iphone - 在类之间传递NSString

iphone - 导航栏上的 titleview 在 segues 后的 View 中不可见

ios - 如何将 UIBarButtonItem tintcolor 设置为非默认 UIColor

reactjs - undefined 不是对象 '_react2.PropTypes.bool'

javascript - React Native 中的 redux-form 有问题