How to make Xcode find file FacebookSDK.h?

前端 未结 17 2088
情歌与酒
情歌与酒 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:40

    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.

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

    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.

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

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

    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.

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

    it is simple, you have to remove your FacebookSDK.framework from your Project.

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

    Now copy this Target settings > framework search path into Project setting > framework search path.

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

    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)

    Voila!.

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