使用带有React Native

编程入门 行业动态 更新时间:2024-10-19 14:42:59
使用带有React Native <0.40.0的FacebookSDK时找不到文件(File not found when using FacebookSDK with React Native < 0.40.0)

我正在使用React Native 0.37.0 (因为我的项目使用的是react-native-navigation , 0.40.0支持RN> = 0.40.0 )并尝试使用Facebook SDK。

我完全遵循了react-native-fbsdk的npm页面上的指令步骤; 并进行双重检查以确保安装完所有内容,并添加所有搜索路径等。

在XCode中运行我的项目时,我在RCTFBSDK库中RCTFBSDK错误。 在文件RCTFBSDKAppEvents.h : RCTFBSDKAppEvents.h 'React/RCTBridgeModuke.h' file not found 。

该文件中的导入行是React 0.40.0的新语法:

#import <React/RCTBridgeModule.h>

有什么办法可以让这些版本的框架一起玩吗? 我需要导航库和脸谱库,所以直到我找到解决方案我才完全被阻止。

我可以分享任何其他东西来支持答案,只要问一下。

I'm using React Native 0.37.0 (because my project uses react-native-navigation which is yet to support RN >= 0.40.0) and attempting to use the Facebook SDK.

I've followed the instruction steps on react-native-fbsdk's npm page, fully; and double-checked to ensure everything is installed, all the search paths are added etc.

When running my project in XCode I get a Buildtime error in the RCTFBSDK library. In the file RCTFBSDKAppEvents.h: 'React/RCTBridgeModuke.h' file not found.

The import line in that file is the new syntax for React 0.40.0:

#import <React/RCTBridgeModule.h>

Is there anything that I can do to make these versions of frameworks play together? I need the navigation library and the facebook one, so until I find a solution I'm completely blocked.

Anything else I can share to support an answer, just ask.

最满意答案

可能是因为您运行的是react-native-fbsdk的最新版本,该版本仅适用于RN >= 0.40 。

尝试卸载react-native-fbsdk:

npm uninstall react-native-fbsdk --save

然后,使用旧版本重新安装:

npm install react-native-fbsdk@0.4.0 --save

Probably because you are running the latest version of react-native-fbsdk which only works with RN >= 0.40.

Try uninstall react-native-fbsdk:

npm uninstall react-native-fbsdk --save

Then, reinstall with an older version:

npm install react-native-fbsdk@0.4.0 --save

更多推荐

本文发布于:2023-08-05 20:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1437999.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:React   Native

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!