Ryne Cheow Ryne Cheow - 6 months ago 58
iOS Question

FacebookSDK and Bolts conflicting each other (duplicate symbols) on build

Not sure what is the problem.. 91 symbols found duplicated for armv7

Am on a Swift project targeting iOS 7.1.

Both frameworks are of the latest versions.

Tried cleaning project and removing derived data., but to no avail.

duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._URL in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._appStoreId in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._appName in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)

Answer

Had the same issue.

  • Removing the Bolts.framework was NOT a solution since I get the errors that Leo Flaherty mentioned (comment in the accepted answer).
  • Using the solution mentioned by iOS_DEV seems like an ugly hack to me.
  • Using the latest Parse and Facebook SDKs was also NOT a solution (mentioned by Simon Bøgh) since I was using the version 3.x of the Facebook SDK and the latest is 4.x. The Facebook SDK Change log mentions: The Facebook SDK for iOS v4.0 is a major version upgrade. Since I needed to meet a deadline, I couldn't dedicate time on re-writing all my Facebook code, to fit with the new 4.x SDK version.

Solution that I propose:

Instead of adding the Bolts.framework and FacebookSDK.framework as framework to your project, add them as Pods:

pod 'Bolts'
pod 'Facebook-iOS-SDK', '3.23.1'

Find here all the Facebook SDK versions available, in case you need to use one which is not the latest.
In case you're using Swift, you need to add the following in your bridging header:
#import <FacebookSDK/FacebookSDK.h> #import <Bolts/Bolts.h>

Comments