更新更新 Xcode 7 后,Facebook sdk 不是 dylib 错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32690590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:53:27  来源:igfitidea点击:

Facebook sdk is not a dylib error after update update Xcode 7?

iosxcodefacebook

提问by Varis Darasirikul

I got some errors with facebook sdk after update Xcode 7 when i tried to build the project like the code below.

当我尝试像下面的代码一样构建项目时,在更新 Xcode 7 后,我在使用 facebook sdk 时遇到了一些错误。

ld: warning: Auto-Linking supplied '/Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit', framework linker option at /Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit is not a dylib
ld: warning: Auto-Linking supplied '/Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit', framework linker option at /Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit is not a dylib
ld: warning: Auto-Linking supplied '/Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKLoginKit.framework/FBSDKLoginKit', framework linker option at /Users/manjarb/Desktop/hubbalabs/lib/FacebookSDK/FBSDKLoginKit.framework/FBSDKLoginKit is not a dylib

enter image description here

在此处输入图片说明

How to fix this? Thanks!

如何解决这个问题?谢谢!

回答by Gerd Castan

When you install Facebook SDK iOS frameworks the way Facebook advices it, you do two things:

当您按照 Facebook 建议的方式安装 Facebook SDK iOS 框架时,您需要做两件事:

    • create a "Frameworks" group in XCode if it doesn't exist
    • drag used frameworks into the "Frameworks" group (this automagically creates an entry in Build Phases -> Link Binary With Libraries)
  1. Set the Framework search Paths to .../FacebookSDKs-iOS/

    • 如果它不存在,则在 XCode 中创建一个“框架”组
    • 将使用过的框架拖到“Frameworks”组中(这会自动在 Build Phases -> Link Binary With Libraries 中创建一个条目)
  1. 将框架搜索路径设置为 .../FacebookSDKs-iOS/

You get this "not a dylib" warning when you succeeded with 2. but did not do 1. correctly.

当您成功执行 2. 但没有正确执行 1. 时,您会收到此“不是 dylib”警告。

In my case I got this warning for the Bolts.framework, which I didn't use directly but is used by FBSDKCoreKit.framework.

就我而言,我收到了针对 的警告Bolts.framework,我没有直接使用它,而是由FBSDKCoreKit.framework.

Dragging Bolts.frameworkinto XCode next to FBSDKCoreKit.frameworkfixed the warning.

拖动Bolts.framework到 XCode 旁边FBSDKCoreKit.framework修复警告。