Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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) 
like image 500
Ryne Cheow Avatar asked Sep 15 '14 03:09

Ryne Cheow


2 Answers

I had the same issue with the 91 duplicates. What worked for me was simply to remove the Bolts.framework which seems to be somehow already included in Facebook new SDK.

Hope it helps!

like image 180
winterized Avatar answered Oct 05 '22 10:10

winterized


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>

like image 23
Alex Avatar answered Oct 05 '22 10:10

Alex