How to make Xcode find the FacebookSDK.h file?

It says: "File FacebookSDK / FacebookSDK.h not found"

However, I can go to the definition in #import, and it returns me to the file.

And as soon as I added #import, now he knows what FBFriendPickerDelegate is, and now he does not have an error in this line.

I have facebookSDK.framework in my project and in the right folder. He has 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 that it can’t find it. I also tried cleaning and restarting. I have the latest version of Xcode.

// // FacebookView.h // #import <UIKit/UIKit.h> #import <FacebookSDK/FacebookSDK.h> @interface FacebookView : UIViewController <FBFriendPickerDelegate> { } 
+47
header-files xcode facebook-ios-sdk
Oct 11
source share
17 answers

First, you must remove your FacebookSDK.framework file from your project. Then start over with these 5 steps. DO NOT regroup the framework.

  • Go to the section "Building phases in your target program."
  • In Link Binary With Libraries, click the "+" button.
  • Click "Add another ..."
  • Find your FacebookSDK folder. Usually in ~ / Documents / FacebookSDK /
  • Clik on (select) "facebookSDK.framework" and then OPEN.

What is it.

+93
Oct. 12
source share

No need to delete anything.

In your project, go to: " Build Settings ", then " Search Paths ". Find the " Search Path Framework ". You probably have something like this:

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

Change it to:

Wireframe Search Ways: $ (PROJECT_DIR)

Voila !.

+23
Mar 17 '14 at 2:53
source share

I tried this, but it did not work for me. I needed to go into the build settings for the project and manually fix the FacebookSDK Framework Search Paths to find the FacebookSDK.

+9
Feb 27 '13 at 16:00
source share

Ok guys, I think I got the answer. Follow these steps.

  • Copy the framework into your project.
  • Make sure it is in some directory. e.g. $(PROJECT_DIR)/project_name/Resources/Frameworks
  • Click on the target.
  • Go to build phase -> Link binaries to libraries
  • Add a custom structure by clicking Add another.
  • Check in the project navigator that the infrastructure exists only once.
  • Now go to "Build Settings" β†’ "Search Paths" β†’ "Map Search Path" and make sure that it has the following two functions.

    (a) $(inherited) (b) $(PROJECT_DIR)/project_name/Resources/Frameworks.

    Do not resemble the framework inside the Frameworks folder

  • Make sure there is nothing in the library search path.
  • Now click on the project (above the goal) β†’ Build settings and repeat steps 7 and 8.
  • Now clear the project and create the project.

Hope this works. Remember to save the folder names with spaces. If you saved them, make sure you provide the correct escape characters.

+6
Oct 21 '14 at 21:21
source share

How to remove facebook sdk links:

For those who, like me, incorrectly added facebook sdk. to remove facebook sdk from your project,

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

go to the build phase β†’ Link the binaries to the libraries and delete any sdk facebook there

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

Now follow the steps of "Fede Cugliandolo" and add facebook sdk

+1
Jul 09 '14 at 5:38
source share

I have a problem today.

It turned out that I needed to have a Framework search path in all three places:

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

My search path:

 /Users/myusername/Documents/FacebookSDK 

After that, make sure the error is gone for me.

+1
Oct 29 '14 at 7:04 on
source share

I use xcode 5, and when adding sdk it does not correctly write its own address in "project.pbxproj".

Instead of the local address for sdk, it saves the global address.

I open "project.pbxproj" and find it in places and leave the address only for sdk in the 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 
0
09 Oct '13 at 11:41
source share

You must change the "Framework Search Path" property in your build settings and indicate where the FacebookSDK.framework file is located (then you can use the SRCROOT variable to point to the root of your project directory, and thus avoid using absolute paths;)) eg

$(SRCROOT)/SampleProject/src/Utils/Facebook/

this is usually done automatically by Xcode when importing the framework of the third part, but sometimes it is messy (for example: when you change the project directory tree ...)

Hope this helps ...

0
Dec 09 '13 at 16:59
source share

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

0
Feb 01 '14 at 2:00
source share

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

For example, I imported facebookSDK into $ project / framework, but for some reason I deleted it. Then I imported it through ~ / Documents / FacebookSDK, but Xcode saved the old folder by default and searched it.

I need to delete all links and old import files to solve my problem.

0
Feb 13 '14 at 9:23
source share

I finished checking the project directory, deleted the old links to the framework file. Then remove it from the build / search paths. Also remove the associated structure. Restart Xcode and perform this process again: drag the Framework into the Framework, do not copy. Check build paths / search. include "#import". Finally worked. Phew

0
Mar 06 '14 at 5:19
source share

Follow the instructions in Step 4 Set up an Xcode project I think you are missing something. Delete the Facebook.sdk file in your project and try again.

0
May 26 '14 at 6:37
source share

I had the same problem when I updated Xcode, but in my case I didn’t want to make any manual changes to the project settings, since I use CMake to create it. You can find the way I fixed it here: stack overflow

0
Oct 20 '14 at 9:37
source share

it's simple, you need to remove your version of FacebookSDK.framework from your project.

Go to the "Build Phases" section in your target program. In Link Binary With Libraries, click the "+" button. Click the "Add another ..." button. Browse your FacebookSDK folder. Usually in ~ / mohit / Documents / FacebookSDK / Clik on (select) "facebookSDK.framework" and then OPEN.

Now copy these target settings> wireframe search path to the project setup> wireframe search path.

0
Mar 17 '15 at 6:24
source share

None of the above answers worked for me.

Which eventually got the trick for me to change the plugin folder structure:

  • Create folder: com.phonegap.plugins.facebookconnect/FacebookSDK

  • Copy all content from: com.phonegap.plugins.facebookconnect/FacebookSDK.framework/Headers to com.phonegap.plugins.facebookconnect/FacebookSDK

  • Copy com.phonegap.plugins.facebookconnect/Facebook.framework to com.phonegap.plugins.facebookconnect/FacebookSDK

And finally, change

 #import <FacebookSDK/FacebookSDK.h> 

to

 #import "FacebookSDK/FacebookSDK.h" 
0
May 9 '15 at 13:52
source share

The only solution I found was:

  • Remove phonegap plugin: rm ion plugin phonegap-facebook-plugin

  • Clone the following git clone plugin: https://github.com/jeduan/cordova-plugin-facebook4.git

  • Add plug-in manually: plug-in cordova -d add PATH / cordova-plugin-facebook4 - variable APP_ID = "*****" - variable APP_NAME = "*****"

Before that, I tried to add the FacebookSDK.framework file and install facebook facebook through local cloning, but the error continues.

0
Mar 24 '16 at 1:02
source share

Follow these steps:

  • Click the "Xcode Build Settings" tab in your project.
  • Add ~ / Documents / FacebookSDK to the Path Path Path setting.
0
Oct 18 '16 at 12:05
source share



All Articles