Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

objective c - Facebook iOS8 SDK build module error for FBSDKCoreKit

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 module 'FBSDKCoreKit'" error when I add the header to my AppDelegate.m file.

#import "AppDelegate.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>

Based on what I read elsewhere

  1. I have already cleaned the build and re-installed Xcode.
  2. I also re-installed the Facebook SDK installer and tried to add it to a blank project (in case there was something corrupt with my app).
  3. I have double checked the plist and the framework files FB lists in the instructions, but nothing has seemed missing.

I'm stumped.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...