FBSDKCoreKit/FBSDKCoreKit.h not found error
Make sure to follow this step:
Deselect Copy items into destination group's folder. https://developers.facebook.com/docs/ios/getting-started/
Also, in your Build Settings, look at this field: "Framework Search Paths" You should have something like this:
/Users/[username]/Documents/FacebookSDK
or for a more general config
~/Documents/FacebookSDK
Also, look at Finder and make sure that the framework is actually there
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
- Clean Build -> ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
- Clean Build Folder -> ⌥⇧⌘K (Option+Shift+Command+K)
- Close Xcode // important! - Otherwise it recreate the DerivedData for the current open project automatically
Run this command in terminal
rm -rf ~/Library/Developer/Xcode/DerivedData
Open XCode and build successfully
I got to solve this by deleting the Framework and adding it again by right click on the project->Add files..., then choose the framework and SELECT the option to Copy files if needed. I know it's not what Facebook recommends, but I couldn't make it work doing that, but this way it worked! I'm using v4.6 of FBSDK and Xcode 7 beta 6. Hope it helps you and everyone else who's facing the same problem :)
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)!