FBSDKCoreKit/FBSDKCoreKit.h not found error

后端 未结 27 1711
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 11:07

I am implementing FB Login so i Downloaded the SDK from https://developers.facebook.com/docs/ios. then i drag n down FBSDKCoreKit, FBSDKLoginKit a

相关标签:
27条回答
  • 2020-12-04 11:34

    This also took me hours of pain! Finally I found the root problem.

    The Facebook SDK MUST be located at ~/Documents/FacebookSDK

    This is because in the RCTFBSDK project this path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project (it will be shown in the error console)!

    0 讨论(0)
  • 2020-12-04 11:34

    Solution to the problem if your FacebookSDK is different than

    ~/Documents/FacebookSDK

    Because you don't want iCloud Drive to load up with FacebookSDK; you have to change the "Framework Search Paths" for the added

    react-native-fbsdk

    This is because in the RCTFBSDK.xcodeproj inside Libraires; path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project.

    1. Select the Project
    2. Libraries
    3. Select "RCTFBSDK.xcodeproj"
    4. Build Settings
    5. Add your custom path in "Framework Search Paths" eg: /Users/rajanmaharjan/FacebookSDK
    6. Clean Build -> ⇧⌘K (Shift + Command + K) - to clean build frameworks.
    7. Build the project; it should build successfully.
    0 讨论(0)
  • 2020-12-04 11:34

    When you add the directory to your Build Settings -> "Framework Search Paths", make sure you add it to both Debug AND Release.

    Silly error but if you're new to iOS dev in xcode you could miss this.

    0 讨论(0)
  • 2020-12-04 11:37

    After troubleshooting using several answers here. This is what I did.

    1. I changed ~/Documents/FacebookSDK to "$(HOME)/Documents/FacebookSDK" note: I used quotes "
    2. I moved "$(HOME)/Documents/FacebookSDK" to the top of the list in header search paths.
    0 讨论(0)
  • 2020-12-04 11:38

    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

    0 讨论(0)
  • 2020-12-04 11:38

    If any of the above answers didn't work, try this:

    Open your ~/Documents/FacebookSDK folder. Check if there is this cloud icon right of the filenames:

    If so, macOS removed your files from your computer and uploaded them to iCloud! (thanks Apple)

    You can:

    1. Click on all the cloud icons, it will download the files back
    2. Disable Storage Optimization on your mac to prevent it from happening again
    0 讨论(0)
提交回复
热议问题