How to make Xcode find file FacebookSDK.h?

前端 未结 17 2087
情歌与酒
情歌与酒 2020-12-02 20:23

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 i

相关标签:
17条回答
  • 2020-12-02 20:29

    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

    0 讨论(0)
  • 2020-12-02 20:30

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

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

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

    0 讨论(0)
  • 2020-12-02 20:31

    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.

    0 讨论(0)
  • 2020-12-02 20:32

    Just follow these steps:

    1. Open Xcode's Build Settings tab in your project.
    2. Add ~/Documents/FacebookSDK to the project's Framework Search Paths setting.
    0 讨论(0)
  • 2020-12-02 20:35

    None of all answers above worked for me.

    What finally did the trick for me was to change the structure of the plugin folder:

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

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

    3. 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 讨论(0)
  • 2020-12-02 20:38

    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: https://stackoverflow.com/a/25564152/525873

    0 讨论(0)
提交回复
热议问题