Take the 2-minute tour ×

It says "FacebookSDK/FacebookSDK.h file not found"

Yet I can jump-to-definition on the #import and it takes me to the file.

And once I added the #import it now knows what FBFriendPickerDelegate is and it now doesn't have an error on that line.

I have the facebookSDK.framework in my project and in the right folder. It's SDK 3.1. I tried adding search paths to /FacebookSDK and /FacebookSDK.framework and /FacebookSDK/Versions/A/Headers etc. I also tried #import "FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h" and it still says it can't find it. I also tried clean and restarting. I have the latest version of Xcode.

//  FacebookView.h

#import <UIKit/UIKit.h>
#import <FacebookSDK/FacebookSDK.h>

@interface FacebookView : UIViewController <FBFriendPickerDelegate>
share|improve this question

13 Answers 13

up vote 74 down vote accepted

First, you have to remove your FacebookSDK.framework from your Project. Then start over again with these 5 steps. DO NOT re-link the framework.

  1. Go to Build Phases in your Project Target.
  2. In Link Binary With Libraries, click the "+" button.
  3. Click on "Add Other..." button
  4. Browse your FacebookSDK folder. Generally in ~/Documents/FacebookSDK/
  5. Clik on (select) "facebookSDK.framework" and then OPEN.

That's it.

share|improve this answer
I did that. The only way I got it work is by doing #import "FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h" –  curtis Oct 15 '12 at 18:26
First, you have to remove your FacebookSDK.framework from your Project. Then start over again with those 5 steps. DO NOT re-link the framework –  Fede Cugliandolo Oct 19 '12 at 17:05
Thanks @FedeCugliandolo that worked for me –  bkbeachlabs Jan 26 '13 at 1:43
i did this and getting this error ld: framework not found FacebookSDK clang: error: linker command failed with exit code 1 (use -v to see invocation) –  khalil Apr 9 '13 at 2:34
@khalil I got that error, and fixed it by restarting Xcode. This overall answer didn't work for me, though. –  Greg Krsak Jun 29 '13 at 18:45

I tried this but it did not work for me. I had to go into the Build Settings for the project and manually fix the FacebookSDK Framework Search Paths to find the FacebookSDK.

share|improve this answer
shareKit also error with this info :'FacebookSDK.h' file not found –  zszen Mar 9 '13 at 17:42
This helped! Projects where you work with other developers often missing $(SRCROOT) and has 'hard' paths to Libraries and Frameworks instead. –  Eugene Dubinin Dec 23 '13 at 9:59
Perfect Boss... I set using (SRCROOT) in Framework Search Path it work in all system. –  Siten Mar 19 at 4:52

No need to remove anything.

In your project go to: "Build Settings”, then “Search Paths". Look for "Frameworks Search Paths". You probably have something fixed like this:

Frameworks Search Paths: /Users/john/Documents/exampleappxyz

Change it to:

Frameworks search paths: $(PROJECT_DIR)


share|improve this answer
Your solution works as charm. And I believe this is the right answer. –  Vincent Mar 20 at 2:11
I also think it's the right answer, but don't work for me; may still has others issue in my project. By the way, I copy the project from another machine. –  Stony Oct 17 at 7:47

How to remove facebook sdk links:

For those who like myself improperly added the facebook sdk. to remove the facebook SDK from your project,

check the link inside your frameworks folder, delete any facebook sdk link in there

go into Build Phases -> Link Binary With Libraries and delete any facebook sdk in there

Right click on the frameworks folder and select "show in finder" and delete any facebook sdk in there

Now follow "Fede Cugliandolo"'s steps and re add the facebook sdk

share|improve this answer

Ok guys, I think i got the answer. Follow the steps given below.

  1. Copy your framework into your project.
  2. Make sure it is under some directory. e.g.$(PROJECT_DIR)/project_name/Resources/Frameworks
  3. Click on the target.
  4. Goto Build Phases->Link binary with Libraries
  5. Add the custom framework by clicking "Add Other"
  6. Verify in the project navigator that the framework exists only once.
  7. Now goto Build Settings->Search Paths->Framework Search Path and make sure that it has the following two things. (a) $(inherited) (b) $(PROJECT_DIR)/project_name/Resources/Frameworks. Not to remind the framework exists inside the "Frameworks" folder
  8. Make sure that there is nothing in the library search path.
  9. Now click on the project (above target)->Build settings and repeat steps 7 and 8.
  10. Now clean the project and build the project.

Hope it works. Please remember not to keep any folder names with spaces. If you have kept them, make sure that you provide the correct escape characters.

share|improve this answer

I use xcode 5 and when add sdk it not correct write self address in "project.pbxproj".

Instead local address for sdk it save global address.

I open "project.pbxproj" and finde the places of it and leave address only for sdk in project.

<project name>/src/external/facebook
<project name>/src/external/testflight

to edit the entry was as follows

/Users/<user Name>/myProjects/.../ios/<project name>/src/external/facebook
share|improve this answer

You have to change the property "Framework search path" in your build settings, and specify where the file FacebookSDK.framework is located (you can then use the SRCROOT variable to point to the root of your project directory, and thus, avoid using absolute paths ;)) e.g. :


this is normally done automatically by Xcode when you import a third part framework, but it messes sometimes, (eg: when your modify your project directory tree...)

Hope that helps...

share|improve this answer

besides adding the search path I also had to set the paths to recursive and remove "*.framework" from the "Sub Directories to Exclude" option for this to work.

share|improve this answer

This happens if you have imported the facebookSDK twice and after having deleting some files.

For example, I imported the facebookSDK in $project/framework but I deleted it for some reasons. Then I imported it via ~/Documents/FacebookSDK but Xcode kept the old folder and search in it by default.

I have to remove all references and files of the old import to resolve my issue.

share|improve this answer

I ended up checking my project directory, remove any old references to the framework file. Then, remove it from Build Phases/Search paths. Also remove the linked Framework. Restart Xcode, and do the process over again: drag Framework to Frameworks, don't copy in. Check the Build Phases/Search paths. include "#import ". Finally worked. Whew.

share|improve this answer

Follow the instruction At step 4 Configure your Xcode Project I think you missing something. Delete the Facebook.sdk in your project and try again.

share|improve this answer

I had the same issue when I updated XCode, but in my case I didn't want to make any manual changes to the project settings as I use CMake to create it. You can find the way I fixed it here: http://stackoverflow.com/a/25564152/525873

share|improve this answer

I got this problem today.

It turns out I need to have my Framework search path in all three places:

1) Project Build Settings
2) App Target Build Settings
3) UnitTests Target Build Settings

My search path is:


After ensure that, the error disappeared for me.

share|improve this answer

Your Answer


