24

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?

Swapnil Luktuke
  • 10,385
  • 2
  • 35
  • 58
aabulkhairov
  • 366
  • 2
  • 9

3 Answers3

57

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.

Community
  • 1
  • 1
stipe108
  • 1,640
  • 1
  • 16
  • 20
  • thank you very much.. i was about to go back to Xcode 4.3 and FBSDK 3.0.. you saved me a lot of trouble.. – Swapnil Luktuke Sep 27 '12 at 00:55
  • Thanks - actually we should update the documentation on https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/upgrading-from-3.0/ to reflect this too – James Pearce Sep 27 '12 at 07:09
  • 1
    setting all 3 frameworks to optional worked for me. thank you. – edhnb Oct 01 '12 at 16:25
  • 2
    While setting the libraries to "optional" will fix the specified problem, if you are already using "Accounts.framework" as a required framework (because you are doing Twitter stuff too, for example), then you will end up with another FB error: "Symbol not found: _ACFacebookAppIdKey". This is apparently known to FB (http://developers.facebridge.net/bugs/151020075041952?browse=search_507161bbeb6c42b26696046) but the recommended solution clearly won't work for everyone. – tomo Oct 31 '12 at 16:57
  • 2
    This doesn't work for me! I've set all of the three frameworks to optional, Base SDK is 6.0, Deployment target is 5.1 and architectures are armv7 and armv7s and I keep getting the error about adSupport framework not found! What should I do? – Martin Herman Nov 21 '12 at 20:26
10

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

VSN
  • 2,361
  • 22
  • 30
1

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]"

MattyG
  • 8,449
  • 6
  • 44
  • 48
  • @JoeBlow Remove them from the 'Link Binary With Libraries' list in Build Phases settings. I don't think there is any consequence or affect of leaving them referenced in the Project Navigator. You might remove them from there to reduce clutter or reduce confusion if you have lots of targets and aren't linking to the libraries for any of your targets. – MattyG Mar 15 '14 at 01:15