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
React native RTCRootView.h not found
提问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 example
directory, run npm install
to install the dependencies.
Then, open swipeoutExample.xcodeproj
and run.
在example
目录下,运行npm install
安装依赖。然后,打开swipeoutExample.xcodeproj
并运行。
edit (2015-10-12):
编辑(2015-10-12):
react-native-swipeout has been updated to use the latest react-native including ./ios
and ./android
directories.
react-native-swipeout 已更新为使用最新的 react-native 包括./ios
和./android
目录。
- iOS: Open the xcode project in the
./ios
directory and run it. - Android: Start a simulator, then run
react-native run-android
in 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
回答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