Facebook iOS8 SDK build module error for FBSDKCoreKit

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

提交回复
热议问题