FBSDKCoreKit.framework/FBSDKCoreKit:通用包装器中没有匹配的体系结构

Fiz*_*zix 6 facebook objective-c ios facebook-ios-sdk swift

我正在尝试将核心Facebook SDK设置到我的项目中.我的项目是基于Swift的,但SDK是ObjectiveC.

我复制了两个Bolts.frameworkFBSDKCoreKit.Framework进入我的项目.我设置了一个完美的桥接文件.然后我将以下内容添加到我的AppDelegate.swift文件中:

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)
}
Run Code Online (Sandbox Code Playgroud)

该项目构建,虽然在我的设备上运行时因错误而在启动时崩溃FBSDKCoreKit.framework/FBSDKCoreKit: no matching architecture in universal wrapper.

bry*_*ejl 2

发生这种情况是因为包含了错误的框架。

从嵌入式二进制文件部分删除所有 FBSDK 和 Bolts 框架。现在单击加号并再次添加它们,确保选择每个的“iOS”版本。