Facebook iOS8 SDK build module error for FBSDKCoreKit

后端 未结 16 1611
生来不讨喜
生来不讨喜 2020-11-30 21:33

I am trying to add the Facebook SDK to my iOS 8 Objective-C app in Xcode. I did the install according to the FB-dev instructions. However, I get a \"Could not build

相关标签:
16条回答
  • 2020-11-30 22:04

    Not sure if it has side effects but setting the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings solved the problem for me. Hope it works for you too.

    0 讨论(0)
  • 2020-11-30 22:05

    Just doing the following let me to build the app successfully.

    In Build settings Set "Allow Non-modular Includes in Framework modules" flag to YES

    And I didn't want to Set "Enable Modules" (c and Objective-C) to NO

    enter image description here

    0 讨论(0)
  • 2020-11-30 22:07

    I got the same problem, I was using the newest Facebook SDK (FacebookSDKs-iOS-20160316) on Xcode 6.4, it consistently gives me this error whenever I put the following code in my AppDelegate.m file: #import <FBSDKCoreKit/FBSDKCoreKit.h>

    When I switched to Xcode 7.2, problem solved, the error is gone. Guess this maybe the version compatible issue

    If you are facing the same issue with me, you can have a try to use Xcode 7.2 to build it. Problem is Xcod 6.4 may never be able to used as long as you keep the Facebook sdk in your project.

    Hope this helps!

    0 讨论(0)
  • 2020-11-30 22:08

    Make sure you've also imported the Bolts framework, this worked for me.

    0 讨论(0)
  • 2020-11-30 22:09

    If you are having issue with 'FBSDKCoreKit' You can try below solutions:

    1. Goto Build Setting and search for "allow non-modular" and Set

      "Allow Non-modular Includes in Framework modules" flag to YES

    enter image description here

    1. Go to Document/FacebookSDK folder

      then goto FBSDKCoreKit.framework

      In this folder Remove Modules folder. Then add the FacebookSDK library in your project.

    2. Set the Framework search path to "~/Documents/FacebookSDK"

      Steps to find Framework search Path

      Goto build setting of the project and search for "framework search path".

      Then add "~/Documents/FacebookSDK"

    enter image description here

    Edit:

    please open the Framework search path in Facebook app and copy paste all the paths mentioned over there in your application.Similar to the path i have attached in below screen shots

    enter image description here

    This will fix your problem

    0 讨论(0)
  • 2020-11-30 22:09

    I should direct you to this current open issue assigned to Facebook: https://developers.facebook.com/bugs/362995353893156/. None of the answers here helped me, so I assume we just sit ducks:

    As at time of writing, a message from Facebooks Chris Pan:

    "The 4.0.1 release added module maps (which should have obviated the need for bridging headers) but it looks like that may have caused some other compatibility issues. We're working on a proper fix but another workaround is to remove the module maps manually from each of the FBSDK*Kit.framework bundles; e.g., rm -r ~/Documents/FacebookSDK/FBSDKCoreKit.framework/Modules/ (and repeat for FBSDKLoginKit and FBSDKShareKit)"

    Kosala Ubayasekara got it to work, but since this is an open issue you might want to simply wait until an official fix is clear:

    1. In Build Settings under Apple LLVM Modules:

      1. Set Allow Non-modular Includes in Framework modules" setting to NO
      2. Enable Modules (C and Objective C) to NO.
    2. Create a bridging header to include the Facebook SDK headers

    3. Link bridging header in Build Settings : Swift Compiler - Code Generation.
    4. Import FBSDKCoreKit into your App Delegate file and implement the core Facebook SDK requirements as per the FB documentation
    0 讨论(0)
提交回复
热议问题