Facebooksdk and Bolts Conflicting Each Other (Duplicate Symbols) on Build

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

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>

Parse and facebook sdk -duplicate symbol

Using Facebook and Parse Framework at the same time will cause a multiple duplicate symbol. No idea why this happens also. Removing Bolts.framework from Parse will resolve this issue.

Error: duplicate symbol _BFTaskMultipleExceptionsException

Thanks to a comment from @vadian that brought me to look into my PAWAppDelegate.m and I found that after I comment out this line:

NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";

the error disappears.

Contradicting frameworks on -ObjC

( I think this should be a comment, but I don't have enough rep yet, hope this helps to solve this.)

I'm having the exact same problem (with SponsorPay SDK instead of FirebaseSDK), Facebook SDK & Parse work fine together until i add the -ObjC flag, needed by SponsorPay to work.

Deleting Bolts.framework is not the solution, since that gives some linking errors:

"_BFTaskMultipleExceptionsException", referenced from:

___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke214 in Parse(PFObject.o)

___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke311 in Parse(PFObject.o)

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I get the exact same error if I use the Bolts.framework included in the FacebookSDK package.

But, using the Bolts.framework included in the Parse Library I got a different error:

ld: 91 duplicate symbols for architecture x86_64

All frameworks and libraries are updated.

EDIT:

Using cocoapods solved the problem for me too!

Contradicting frameworks on -ObjC

( I think this should be a comment, but I don't have enough rep yet, hope this helps to solve this.)

I'm having the exact same problem (with SponsorPay SDK instead of FirebaseSDK), Facebook SDK & Parse work fine together until i add the -ObjC flag, needed by SponsorPay to work.

Deleting Bolts.framework is not the solution, since that gives some linking errors:

"_BFTaskMultipleExceptionsException", referenced from:

___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke214 in Parse(PFObject.o)

___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke311 in Parse(PFObject.o)

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I get the exact same error if I use the Bolts.framework included in the FacebookSDK package.

But, using the Bolts.framework included in the Parse Library I got a different error:

ld: 91 duplicate symbols for architecture x86_64

All frameworks and libraries are updated.

EDIT:

Using cocoapods solved the problem for me too!

Parse (1.3.0.1) forces include of Facebook sdk, but conflicts with libPods.a

Now we are on Parse 1.4.0...yay.

Seems like the pod update is not working.

I ended up linking in the 1.4.0 frameworks from https://www.parse.com/apps/quickstart#parse_data/mobile/ios/native/existing:

Parse.framework
ParseFacebookUtils.framework

I had to the Bolts.framework due to conflicts, and installed the FacebookSDK via developers.facebook.com.

Then I made sure these frameworks were installed:

AudioToolbox.framework
CFNetwork.framework
CoreGraphics.framework
CoreLocation.framework
libz.dylib
MobileCoreServices.framework
QuartzCore.framework
Security.framework
StoreKit.framework
SystemConfiguration.framework

and another Parse forgot to mention in their docs:

Social.framework

Things are now running with the latest Parse 1.4.0

Duplicate Symbols for Architecture arm64

From the errors, it would appear that the FacebookSDK.framework already includes the Bolts.framework classes. Try removing the additional Bolts.framework from the project.

Getting Error on compiling project with Parse

Found the solution over here: https://stackoverflow.com/a/29724276/4841900
The reason was Bolts and FacebookSDK were conflicting each other so i was getting duplicate symbol errors.

Parse loginWithUsernameInBackground block callback not working

Unfortunately I cannot comment on your question (not enough reputation), but it seems you have an old FacebookSDK in your project. Xcode gives you a duplicate symbols error, which is caused by the fact that your (old) FacebookSDK has Bolts integrated. The moment you integrate it from the Parse SDK, you have it effectively two times in your project, resulting in the duplicate symbols error.

Please update your FacebookSDK to the last v3 version, available here. Then, use the latest ParseSDK, and include everything from Parse (also ParseUI, Bolts, etc, everything from their SDK folder EXCEPT the v4Facebook framework) into your project.

This should do the trick and your method:

[PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {        
if (!error) {
//do stuff with user
} else {
//error handling here
}

should work.



Related Topics



Leave a reply



Submit