6

I'm trying to setup the core Facebook SDK into my project. My project is Swift based, yet the SDK is ObjectiveC.

I copied both Bolts.framework and FBSDKCoreKit.Framework into my project. I setup a bridging file which works perfectly. Then I added the following to my AppDelegate.swift file:

import FBSDKCoreKit

func applicationDidBecomeActive(_ application: UIApplication) {
    FBSDKAppEvents.activateApp()
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    return true
}

func application(_ application: UIApplication, openURL url: URL, sourceApplication: String, annotation: Any) -> Bool {
    return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}

The project builds, although crashes on start when running on my device with the error FBSDKCoreKit.framework/FBSDKCoreKit: no matching architecture in universal wrapper.

Fizzix
  • 23,679
  • 38
  • 110
  • 176
  • In terminal, `cd` to where your `FBSDCoreKit.framework` is and run `lipo -i FBSDKCoreKit.framework/FBSDKCoreKit`. Do any of the architectures printed out from `lipo` match the architecture of your device? – James Zaghini Oct 27 '16 at 02:28
  • Did you try installing the SDK using cocoapods – Naveen Ramanathan Oct 27 '16 at 05:32
  • @Fizzix, did you find the answer to this? I'm finding Facebook's SDKs (and programming practices in general) to be really awful. – Mike Cole Jan 04 '17 at 06:29

1 Answers1

2

This is happening because the wrong frameworks are being included.

Delete all FBSDK and Bolts frameworks from your embedded binaries sections. Now click the plus sign and add them again making sure to select the "iOS" versions of each.

brycejl
  • 1,411
  • 17
  • 22