Facebook iOS8 SDK build module error for FBSDKCoreKit

后端 未结 16 1612
生来不讨喜
生来不讨喜 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:11

    Remove Module Directory From FacebookCoreKit.framwork.

    enter image description here

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

    For Objective-C I used Paul Lehn answer from: https://developers.facebook.com/bugs/362995353893156/

    1. Add the -ObjC flag to your project's Other Linker Flags build setting. (if you don't want add to project configs, for initialise buttons classes)
    2. "Allow Non-modular Includes in Framework modules" setting to YES in Build settings
    3. Set "Enable Modules" (c and Objective-C) to No

    (also don't forget add frameworks, for me it was: "AdressBook" "QuartzCore" "CoreLocation" "CoreGraphics" and if still not added, also "UIKit" "Foundation" "CoreData")

    and its finally worked for me

    all this used for linked FBSDK in custom folder in my project folder not from ~/Documents/FacebookSDK

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

    TL;DR Remove your Bolts.framework reference in your project.

    None of these or any of the other answers worked for me (in my case). For my project we were switching from an older Facebook sdk and we had a Bolts.framework.

    Reading the documentation

    The SDK automatically loads its framework and resource dependencies.

    As such I think there is a collision going on. There was the Bolts.framework I had from before and then the new one that came when I downloaded the new FacebookSDK bundle (4.7 in this case).

    Removing my Bolts.framework fixes the problem (be sure to clean before rebuilding).

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

    FBSDKCoreKit can't be built because of "include of non-modular header inside framework module" error in FBSDKAppLinkResolver.h header file: in #import <Bolts/BFAppLinkResolving.h> line.

    The solution from Swift compiler error: "non-modular header inside framework module" (switching CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES) did't help me.

    My solution:

    1. Create in Bolts.framework file module map: Modules/module.modulemap (like in FBSDKCoreKit.framework)
    2. Put such code inside

      framework module Bolts {
      umbrella header "Bolts.h"
      
      export *
      module * { export * }
      
      
      explicit module BFAppLinkResolver {
          header "BFAppLinkResolver.h"
          link "BFAppLinkResolver"
          export *
      }}
      

    Interesting fact is that in FBSDKCoreKit such scheme is realized by Facebook, why didn't they apply it into Bolts...

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