找不到'React / RCTComponentEvent.h'文件

时间:2019-08-15 10:10:19

标签: react-native version fbsdk react-native-fbsdk

我将react-native-fbsdk升级到1.0.1后遇到了这个问题

/Users/mahgolfathi/plusless-app/node_modules/react-native-fbsdk/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m:22:9: fatal error: 'React/RCTComponentEvent.h' file not found
#import <React/RCTComponentEvent.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

1 个答案:

答案 0 :(得分:1)

1-您应该将本机版本升级到6

  • 使用react-native -v
  • 检查您的版本

2-用RCTFBSDKLoginButtonManager.m中的导入更改行:

#import<React/RCTComponentEvent.h>

更改为:

#import "RCTComponentEvent.h"

3-选择项目RCTFBSDK.xcodeproj,选择目标RCTFBSDK,选择Build Settings,搜索“ header”,选择“ Header Search Paths”,然后添加此新行:${SRCROOT}/../../../node_modules/react-native/React/Base,作为非递归代码。