I am implementing FB Login so i Downloaded the SDK from https://developers.facebook.com/docs/ios.
then i drag n down FBSDKCoreKit
, FBSDKLoginKit
a
This also took me hours of pain! Finally I found the root problem.
The Facebook SDK MUST be located at ~/Documents/FacebookSDK
This is because in the RCTFBSDK project this path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project (it will be shown in the error console)!
Solution to the problem if your FacebookSDK is different than
~/Documents/FacebookSDK
Because you don't want iCloud Drive to load up with FacebookSDK; you have to change the "Framework Search Paths" for the added
react-native-fbsdk
This is because in the RCTFBSDK.xcodeproj inside Libraires; path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project.
When you add the directory to your Build Settings -> "Framework Search Paths", make sure you add it to both Debug AND Release.
Silly error but if you're new to iOS dev in xcode you could miss this.
After troubleshooting using several answers here. This is what I did.
~/Documents/FacebookSDK
to "$(HOME)/Documents/FacebookSDK"
note: I used quotes "
"$(HOME)/Documents/FacebookSDK"
to the top of the list in header search paths.After updating Cocoapods 1.0.0
, I deleted pod.lock
and installed the current stable pod versions (4.7.0
to 4.11.0
) of FBSDKCoreKit
, FBSDKLoginKit
, FBSDKShareKit
Then i encounter the same error. What i did was:
Added Header Search Paths Build Settings in Xcode:
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"
Then i still had error for another file. Because XCode is using prebuild frameworks.
FBSDKCoreKit/FBSDKCopying.h not found
Run this command in terminal
rm -rf ~/Library/Developer/Xcode/DerivedData
Open XCode and build successfully
If any of the above answers didn't work, try this:
Open your ~/Documents/FacebookSDK
folder.
Check if there is this cloud icon right of the filenames:
If so, macOS removed your files from your computer and uploaded them to iCloud! (thanks Apple)
You can: