Facebook iOS8 SDK build module error for FBSDKCoreKit

后端 未结 16 1610
生来不讨喜
生来不讨喜 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 21:50

    Got this issue too, you need to set

    Enable Modules (C and Objective-C)
    

    to NO.

    0 讨论(0)
  • 2020-11-30 21:51

    You're probably importing the "Samples" folder that comes with Facebook's SDK into your project. Remove the references to those files from your project and it should work. No need to change flags on your build settings.

    0 讨论(0)
  • 2020-11-30 21:55

    Same issue was with me. ... Non of the above solution works for me.. I set . modules, flags and other things also... but nothing help to it.

    But for me this issue is solved by

    MOVE your framework folder AFTER or WITHIN the folder where .pch file is located at.

    When my framework folder @ myapp/{frameworkFolder}/fbframeworks.
    It was showing issues.

    I move it to myapp/myapp/modal/{fbframework}/. Then this issue was solved. (my .pch file is located at myapp/myapp.)

    May be the same can help to anyone having same issue.

    0 讨论(0)
  • 2020-11-30 21:59

    I have faced the same problem. The issue was that my project directory contained space in the name "Application Demo". That's why whenever I dragg the Facebook frameworks then it added space in Framework Search Paths in settings. Remove this space resolved the issue.

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

    From Chris Pan (Facebook Team): https://developers.facebook.com/bugs/362995353893156/

    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)

    As far as I know, we have 2 options to deal with this problem:

    1. Remove all module maps as Chris said.
    2. Add a temporary (unofficial) missing module map file in Bolts.framework folder (in FacebookSDK folder). You should check if this folder is missing or not.
    0 讨论(0)
  • 2020-11-30 22:02

    For those who came here and made the same rookie mistake like I did. Maybe I can save you some time. I work on an old project which largely consists of Objective-C code. We try to implement new stuff in Swift.

    This was what i tried in my Swift code

    import FBSDKCoreKit
    
    class SomeClass {
    
      func doSomething {
        FBSDKAppEvents.logEvent("Some Event")
      }
    }
    

    But the compiler complained that it could not compile the module, etc.

    How I solved it

    • Remove the import FBSDKCoreKit from my Swift code.
    • Edited our Bridging-Header.h and imported FBSDKCoreKit there: #import <FBSDKCoreKit/FBSDKCoreKit.h>
    0 讨论(0)
提交回复
热议问题