Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK for iOS6/Xcode 4.5 not working [duplicate]

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

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.

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..

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

So.. is that it? Am i literally unable to continue to work for potentially weeks until they support 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.

like image 908
user1168056 Avatar asked Sep 20 '12 13:09

user1168056


2 Answers

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.

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.

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:

  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

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.

good luck!

like image 90
KevinM Avatar answered Oct 29 '22 09:10

KevinM


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.

like image 8
Sudhakar Avatar answered Oct 29 '22 09:10

Sudhakar