为未find的ios反应本机基础标头

在iOS连接阶段,我开始看到我的React Native项目的错误。

React Native版本: 0.41.2

所有的工作正常,我编辑的Android版本,React的本地代码没有改变,当这种types的链接错误开始出现在/node_modules/react-native/React/Base/{RCTHeaderName.h}path找不到:

错误

 In file included from /Users/user/ReactNativeProject/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.h:9: ../react-native/React/Base/RCTBridgeModule.h:12:9: fatal error: 'React/RCTDefines.h' file not found #import <React/RCTDefines.h> ^ 
  • 链接二进制库我包括核心React库( libReact.a )。

  • RCTLog.h的位置是PROJECTROOT/node_modules/react-native/React/Base/RCTLog.h ,但导入是#import <React/RCTLog.h>

  • 在库中新添加React.xcodeproj并没有什么帮助,Xcode的Product > Clean没有帮助,重新启动Xcode也没有帮助

  • react-native run-android works, react-native run-ios显示错误

  • 将文件权限设置为执行react-native run-ios

你有没有select“ Parallelize build选项,并且在构build目标中首先列出了“反应”?

你可以在Xcode中find这个窗口=>你的项目图标靠近运行button=> Edit scheme => Build选项卡

更新:Facebook上的解决schemeReact-Native https://github.com/facebook/react-native/issues/11813

============

这个问题也发生在我身上。 看来React.xcodeproj只能识别configurationDebugRelease 。 React.xcodeproj的所有输出都写入Debug-iphonesimulatorRelease-iphonesimulator

这意味着如果你有一些configuration,而不是“debugging/发布”,输出仍然会被写入Debug-iphonesimulatorRelease-iphonesimulator ,这不是我们想要的。

所以解决scheme是在React.xcodeproj中添加一个相同的configuration来匹配你自己的项目。

例如,如果您在自己的项目中有“Debug / Release / Test / AppStore”4configuration,则必须确保React.xcodeproj也具有相同的4种configuration。

请点击Configurations的“+”button,然后点击“Duplicate Release Configuration”,并根据需要进行重命名。

在这里输入图像说明