xcode 未找到 React Native RTCRootView.h

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30675628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:14:28  来源:igfitidea点击:

React native RTCRootView.h not found

objective-cxcodereact-native

提问by Spencer Pope

I'm trying to use React native and I am getting an error in xcode that says "Lexical or preprocessor error 'RTCRootView.h' not found." I have checked and this file is in the framework folder and I have tried moving it into the project as well and still have not been able to eliminate the error and successfully build.

我正在尝试使用 React Native,但在 xcode 中出现错误,提示“未找到词法或预处理器错误‘RTCRootView.h’。” 我已经检查过这个文件在框架文件夹中,我也尝试将它移动到项目中,但仍然无法消除错误并成功构建。

回答by Dan Cormier

In the exampledirectory, run npm installto install the dependencies. Then, open swipeoutExample.xcodeprojand run.

example目录下,运行npm install安装依赖。然后,打开swipeoutExample.xcodeproj并运行。

react-native-swipeout#15.

react-native-swipeout#15

edit (2015-10-12):

编辑(2015-10-12):

react-native-swipeout has been updated to use the latest react-native including ./iosand ./androiddirectories.

react-native-swipeout 已更新为使用最新的 react-native 包括./ios./android目录。

  • iOS: Open the xcode project in the ./iosdirectory and run it.
  • Android: Start a simulator, then run react-native run-androidin project root directory. (note: swipeout is currently incompatible with Android, but will be soon.)
  • iOS:打开./ios目录下的xcode工程并运行。
  • Android:启动一个模拟器,然后react-native run-android在项目根目录下运行。(注意:swipeout 目前与 Android 不兼容,但很快就会兼容。)

回答by botbot

Running npm installmight work for some people, but it didn't work for me.

跑步npm install可能对某些人有用,但对我却没有用。

What worked for me was in XCode > Product > Clean XCode >Product >Clean

对我有用的是 XCode > Product > Clean XCode >产品 >清洁

回答by Vadim Guzev

Just faced with the same error. In my case it was because of typing error. I replaced RTCRootView.h with RCTRootView.h (RCT is an abbreviation of ReaCT).

刚刚面临同样的错误。就我而言,这是因为打字错误。我用 RCTRootView.h 替换了 RTCRootView.h(RCT 是 ReaCT 的缩写)。

回答by Abiola

Sometimes it might be because the node_modules folder is missing in your project directory.

有时可能是因为项目目录中缺少 node_modules 文件夹。

  • Move the node_modules folder to your project
  • run npm install in your project directory
  • 将 node_modules 文件夹移动到您的项目
  • 在你的项目目录中运行 npm install