Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK 3.1 for iOS - runs on iOS6, but crashes on iOS 5.x

We've just updated our Facebook SDK for iOS to 3.1. Facebook SDK 3.0.8 didn't run on iOS6, now that we have upgraded to 3.1, it runs on iOS 6, but crashes under iOS 5.x.

because of AdSupport.framework app crashes on iOS 5.x instantly after starting with the following error:

dyld: Library not loaded: /System/Library/Frameworks/AdSupport.framework/AdSupport

Referenced from: /Volumes/Macintosh HD/Users/dmitrybaranov/Library/Application Support/iPhone Simulator/5.0/Applications/D6A93996-1E58-48A5-A457-DBC4FCCEE0EB/app.app/app
        
Reason: image not found
(lldb)

Did anybody face that problem? Is there a problem on Facebook's side and there guys are working on fixing this?

Or are we doing something wrong?

like image 405
aabulkhairov Avatar asked Sep 26 '12 20:09

aabulkhairov


3 Answers

Did you set the frameworks to be optional? When you are adding AdSupport.framework, Social.framework, and Accounts.framework, there is drop down menu to the right that you can select between "Required" and "Optional". See a picture example here: Link

Another thing to check is in your Project's "Build Settings" that 'Base SDK' is 6.0 and 'iOS Deployment Target' is iOS 4.3.

I'm able to build FB SDK 3.1 on my iOS 5.1 with these settings.

like image 135
stipe108 Avatar answered Oct 13 '22 22:10

stipe108


If you're targeting iOS versions less than 6.0, you'll need to make AdSupport.framework, Social.framework, and Accounts.framework optionally-linked.

Please have a look at the attached screenshot.enter image description here

Cheers...!!!

like image 22
VSN Avatar answered Oct 13 '22 21:10

VSN


For anyone reading this and using Facebook SDK 3.6+ for iOS, you no longer need to include these libraries or Optionally link them. See the Facebook docs for Upgrading from 3.5 to 3.6:

"Remove the framework dependencies added to your app when you installed the Facebook SDK. The SDK still depends on them but now loads them automatically making setup simpler. Remove these frameworks / libraries:

Accounts.framework

AdSupport.framework

Security.framework

Social.framework

libsqlite3.dylib [or remove the -lsqlite3.0 linker flag]

[Note: if your app uses any of the APIs from those frameworks / libraries directly, your project should still include the framework explicitly]"

like image 1
MattyG Avatar answered Oct 13 '22 20:10

MattyG