适用于 iOS6/Xcode 4.5 的 Facebook SDK 不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12513222/
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 01:32:33  来源:igfitidea点击:

Facebook SDK for iOS6/Xcode 4.5 not working

xcodefacebooksdkios6xcode4.5

提问by user1168056

Possible Duplicate:
file is universal (3 slices) but does not contain a(n) armv7s slice error for static libraries on iOS, anyway to bypass?

可能的重复:
文件是通用的(3 个切片)但不包含 iOS 上静态库的 (n) armv7s 切片错误,无论如何要绕过?

Recently upgraded Xcode and my iOS devices to the latest respective versions and i'm now unable to build an app using the Facebook SDK (version 3.0.8) for a device - building on the Simulator works fine.

最近将 Xcode 和我的 iOS 设备升级到各自的最新版本,我现在无法使用 Facebook SDK(3.0.8 版)为设备构建应用程序 - 在模拟器上构建工作正常。

Error I'm receiving whilst trying to build:

我在尝试构建时收到的错误:

file is universal (3 slices) but does not contain a(n) armv7s slice: ....FacebookSDK.framework/FacebookSDK for architecture armv7s

I've noticed that on the iOS SDK landing page (http://developers.facebook.com/ios/) they have this peice of text..

我注意到在 iOS SDK 登录页面(http://developers.facebook.com/ios/)上,他们有这样一段文字。

Upgrade to 3.0 SDK. We will be adding support for the much anticipated iOS 6 integration to the SDK in the coming weeks.

升级到 3.0 SDK。在接下来的几周内,我们将添加对备受期待的 iOS 6 集成到 SDK 的支持。

So.. is that it? Am i literally unable to continue to work for potentially weeksuntil they support iOS6?

所以..是这样吗?在他们支持 iOS6 之前,我真的无法继续工作数吗?

I'm hoping there is a quick fix for this, surely I can't be the only one in this situation.

我希望有一个快速解决方案,当然我不能是这种情况下的唯一一个。

Thanks for any help you can offer.

谢谢你的尽心帮助。

回答by KevinM

For a temporary fix you can do what Sudhakar said, but the app won't run on an iPhone 5, (or atleast with my tests it didn't). You really need a properly compiled SDK.

对于临时修复,您可以按照 Sudhakar 所说的进行操作,但该应用程序无法在 iPhone 5 上运行(或者至少在我的测试中没有)。您确实需要一个正确编译的 SDK。

The current Facebook SDK is build for armv6. I hear they are working on getting a new version out asap that is build for armv7.

当前的 Facebook SDK 是为 armv6 构建的。我听说他们正在尽快推出一个为 armv7 构建的新版本。

In the meantime you can clone down the facebook SDK from github and compile the SDK to work with armv7 yourself. Below are the instructions:

同时,您可以从 github 克隆 facebook SDK 并自己编译 SDK 以使用 armv7。以下是说明:

  1. Download or clone a copy of the source code from the git hub page (https://github.com/facebook/facebook-ios-sdk)
  2. Open up the xcode project and in the build settings change the architecture to armv7.
  3. Save and close
  4. Navigate to /scripts and in terminal run build_all.sh
  1. 从 git 中心页面 (https://github.com/facebook/facebook-ios-sdk) 下载或克隆源代码的副本
  2. 打开 xcode 项目并在构建设置中将架构更改为 armv7。
  3. 保存并关闭
  4. 导航到 /scripts 并在终端中运行 build_all.sh

This will then compile the source and output builds/FacebookSDK.framework To get this to work I had to clone the git repository to /Desktop/iOS I replaced the FacebookSDK.framework that was within my app with the newly created version and it worked like a charm.

然后这将编译源代码和输出 builds/FacebookSDK.framework 为了让它工作,我必须将 git 存储库克隆到 /Desktop/iOS 我用新创建的版本替换了我的应用程序中的 FacebookSDK.framework 并且它像一种魅力。

good luck!

祝你好运!

回答by Sudhakar

Click the your are Xcode Project -> in Architures tab -> valid Architures -> keep armv7 only and remove armv7s. In my case it working fine, this is only temparary solution.

单击您的 Xcode 项目 -> 在架构选项卡中 -> 有效架构 -> 仅保留 armv7 并删除 armv7s。在我的情况下它工作正常,这只是临时解决方案。