React-native Xcode 构建失败-> 'RCTAssert.h file not found'

标签 react-native

我完全按照 React-native 入门指南中描述的步骤进行了操作:

https://facebook.github.io/react-native/docs/getting-started.html

当我打开项目并构建它时,构建失败:

RCTAssert.h file not found' in MyProjectNameTests.m .



我错过了什么?

以下是入门指南中的步骤:

Requirements

OS X - This repo only contains the iOS (7+) implementation right now, and Xcode only runs on Mac.

Xcode 6.3 or higher is recommended.

Homebrew is the recommended way to install io.js, watchman, and flow.

Install io.js 1.0 or newer. io.js is the modern version of Node.

Install nvm with its setup instructions here. Then run nvm install iojs-v2 && nvm alias default iojs-v2, which installs the latest compatible version of io.js and sets up your terminal so that typing node runs io.js. With nvm you can install multiple versions of Node and io.js and easily switch between them.

New to npm?

brew install watchman. We recommend installing watchman, otherwise you might hit a node file watching bug.

brew install flow. If you want to use flow. We recommend periodically running brew update && brew upgrade to keep your programs up-to-date.


Quick Start

npm install -g react-native-cli

react-native init AwesomeProject

In the newly created folder AwesomeProject/

Open AwesomeProject. xcodeproj and hit run in Xcode. Open index.ios.js in your text editor of choice and edit some lines. Hit cmd+R in your iOS simulator to reload the app and see your change!

最佳答案

测试应用程序找不到 header ,因为它不在 header 搜索路径中。

在左侧文件列表中,点击左上角的“文件夹”图标,然后在左上角选择您的应用程序。在这种情况下,“AwesomeProject”。

在应用程序图标出现的右侧,按住以更改为 AwesomeProjectTests。

在右侧,单击“build设置”选项卡。

然后向下滚动到标题搜索路径并将“$(SRCROOT)/node_modules/react-native/React”更改为“$(SRCROOT)/../node_modules/react-native/React”。

该应用程序现在应该编译。

关于React-native Xcode 构建失败-> 'RCTAssert.h file not found',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32250172/

相关文章:

ios - 使用框架!在 Podfile 中导致 'React/RCTBridgeDelegate.h' 未找到

react-native - React Native 导航 - 滑动到下一个屏幕

javascript - 从另一个文件添加函数并在 react 中更新父级的状态

typescript - rootDir 和 outDir 的意外行为

javascript - 按钮 - 启用和禁用

image - resizeMode 包含在 native react 中显示图像前后的空间

react-native 博览会问题 : check method of `SceneView`

react 原生多选 : Cannot read the property 'getSelectedItemsExt' of undefined

react-native - 是否可以在 mailto url 中添加新行?

ios - React Native 开发中 Apple Health Kit 的虚假步骤数据