Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FBSDKCoreKit/FBSDKCoreKit.h not found error

Tags:

ios

frameworks

I am implementing FB Login so i Downloaded the SDK from https://developers.facebook.com/docs/ios. then i drag n down FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit frameworks into my project.

when i ran project it works fine. but when i closed and reopen it, then "FBSDKCoreKit/FBSDKCoreKit.h not found error" appears. then again i copy paste FBSDKCoreKit framework into my project's library and error disappear and this process continues. anyone faced this problem before?

what should i do to solve this error?

like image 668
M Swapnil Avatar asked May 09 '15 05:05

M Swapnil


3 Answers

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

like image 132
etayluz Avatar answered Oct 16 '22 18:10

etayluz


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:

  1. 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

  1. Clean Build -> ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
  2. Clean Build Folder -> ⌥⇧⌘K (Option+Shift+Command+K)
  3. Close Xcode // important! - Otherwise it recreate the DerivedData for the current open project automatically
  4. Run this command in terminal

    rm -rf ~/Library/Developer/Xcode/DerivedData
    
  5. Open XCode and build successfully

like image 40
Mihriban Minaz Avatar answered Oct 16 '22 17:10

Mihriban Minaz


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 :)

like image 33
maufadel Avatar answered Oct 16 '22 18:10

maufadel