集成现有的应用程序 iOS 'React/RCTEventDispatcher.h' 文件在 React Native 上找不到 [英] Integrating existing app iOS 'React/RCTEventDispatcher.h' file not found on React Native

查看:279
本文介绍了集成现有的应用程序 iOS 'React/RCTEventDispatcher.h' 文件在 React Native 上找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to integrate an existing app made in Obj-C with React Native. When i don't use any external library it builds successfully, but when i try to integrate with https://github.com/futurice/react-native-audio-toolkit (or any other library) it gives me this error:

'React/RCTEventDispatcher.h' file not found

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

For some reason it can be fixed by changing the import from:

<React/RCTEventDispatcher.h>

致:

"RCTEventDispatcher.h"

推荐答案

1- 从我的 iPhone 模拟器中删除应用程序,然后转到硬件 -> 擦除所有内容 &设置.

1- delete the app from my iPhone simulator and then go to Hardware -> Erase all content & settings.

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

2- delete all your linked dependencies file in your iOS Podfile (pod 'xxxxxxx', :path => '../node_modules/xxxxx)

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

3- close the Xcode, update the pod by writing "pod update" in your iOS folder and then run "react-native link" .

4- 打开 Xcode 并转到 Menu -> Product -> Clean Build Folder 然后在 Xcode 中运行应用程序.

4- open Xcode and go to Menu -> Product -> Clean Build Folder and then run the app in Xcode.

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

5- link manually the "react-native-gesture-handler" into your Xcode

6-从 Xcode 运行您的应用

6-run your app from Xcode

这篇关于集成现有的应用程序 iOS 'React/RCTEventDispatcher.h' 文件在 React Native 上找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆