FBSDKCoreKit/FBSDKCoreKit.h file not found error react-native ios

匿名 (未验证) 提交于 2019-12-03 03:03:02

问题:

Try to install Facebook SDK to react natiove IOS.

I have FBSDKCoreKit/FBSDKCoreKit.h file not found error and spent several hours trying to solve it with different solutions, but can't understand whats going wrong((

Any ideas?

react-native 0.40 react-native-fsdk 0.5.0 facebook sdk: 4.19.0

回答1:

  1. Check if you did react-native link on your RN project.
  2. Manually check in Linked Frameworks And Libraries, that you have libRCTFBSDK.a. If not, hit that + button at the bottom and link it.
  3. When upgrading the project itself react-native from <0.40 make sure you ran react-native upgrade after you've updated the RN package itself with npm install react-native@latest --save
  4. Make sure that you put sdk in ~/Documents/FacebookSDK. I think it's important.

If you come across some errors, sometimes it's better to clear all, and start fresh installation again.

Try:

rm -rf ./node_modules watchman watch-dell-all npm cache clean npm install react-native run-ios 


回答2:

EDIT: I recommend using CocoaPods so you don't need to download/update the sdk manually.


If you downloaded the sdk manually, try this:

  1. Open your ~/Documents/FacebookSDK folder;

  2. Check if it has these cloud icons right of the filenames:

If so, macOS removed your files from your computer and uploaded them to iCloud! (thanks Apple)

  1. Click on all the cloud icons, it will download the files back.

That's it!


If this isn't your case, try these:



回答3:

Had this problem too but my issue was that RCTFBSDK specifically looks in the ~/Documents/FacebookSDK path with a non-recursive setting. To check if you have the same problem, open your Libraries folder and RCTFBSDK.xcodeproj folder. Check if the Frameworks are red

If they are, click on them and in the right sidepanel, change the location to where you store the SDK. I store my Facebook SDKs by version number so that was what caused the problem. For example, version 4.12 is stored in ~/Documents/FacebookSDK/4.12, so RCTFBSDK could not find the correct *.framework.

Also, click on the RCTFBSDK.xcodeproj and add ~/Documents/FacebookSDK with a recursive setting to the Framework Search Paths. It should compile without issues after this.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!