Facebook sdk and Bolts framework (duplicate symbols) - ios

I added Parse 1.10 with Bolts ,when I build an error FacebookSDK.h not found occurs , If I add FacebookSDK framework this occurs.
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._URL in
87 duplicate symbols for architecture i386
If I remove facebookSDK one of Parse header file says FacebookSDK.h not found
and
If I remove Bolts framework one of Parse header file says Bolts.h not found
I downloaded latest FacebookSDK but It does not have FacebookSDK.framework , It contains FBSDKLogin,FBSDKMessengerShareKit and so on...
So I used FacebookSDK.Framework from an old project.
I'm Stuck , Plz Help.
Thanks

Facebook v4.8 SDK does not have facebooksdk.framework.
If you are using the latest version of Parse then,i would recommend using the latest version of facebook sdk too.
Follow this links for making sure that you are integrating it properly.
Facebook getting started
Parse FB integration
For basic login and graph api request from Facebook and linking it to Parse.You need to include FBSDKCoreKit.framework,FBSDKLoginKit.framework,FBSDKShareKit.framework,Parse.framework
I hope that,it helps!

Related

Linker Command Failed Facebook Sdk

I am new to iOS and trying to implement Facebook SDK in a project using AppGuru Facebook integration in Swift tutorial. But I am facing this linker command error while building my app:
error is framework not found Bolts for architecture x84_64(linker command failed with exit code 1)
Here is a screenshot:
Download demo project with facebook login from below URL. you have to configure your facebook app id.
Download
You have to import this 3 frameworks in your project.
Check on this
https://developers.facebook.com/docs/ios
https://developers.facebook.com/docs/facebook-login/ios
Framework search path - add below line
$(PROJECT_DIR)/Projectname/FacebookSDK
Also check, bolts, core and login kit of facebook has to be in build phase -> Link binary with libraries
Follow steps -
Go to your project setting page
Select your project (left side)
Click the Build Settings tab
Search Bitcode
Set Enable Bitcode to No
I had the same error. I deleted the ParseFacebookUtils.framework library from my project and kept only the ParseFacebookUtilsV4.framework.
When using the AWS Mobile SDK for iOS and Facebook SDK together, you should not import Bolts.framework in your project. If you remove it, it should compile.
Copy the frameworks into the project but, unlike what Facebook tutorial suggests, select "Copy items into destination group's folder". I did that and it worked fine for me.

Parse API 1.6.4 - cannot build project

I downloaded the new iOS Parse API (1.6.4) and tried to build my project. When I do, I get this error:
Undefined symbols for architecture arm64" "_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 arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Screenshot:
Temporary workaround for Parse 1.6.4 and Facebook SDK 3.23:
Add to your AppDelegate.m or another class following constant after imports and before implementation section:
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
#interface IPAppDelegate ()
#end
#implementation IPAppDelegate
It should solve the problem until it'll be solved on Parse/Facebook side.
--
Update: This solution is only for Facebook and Parse SDK versions that listed above and these versions right now are outdated.
New Parse SDK 1.7.4 works correct with new Facebook SDK 4.0 and there shouldn't be such a problem.
I was able to figure out the URL for anyone that needs Parse iOS v1.6.3.
https://parse.com/downloads/ios/parse-library/1.6.3
I can confirm that everything compiles properly using 1.6.3.
Placing
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
in the App Delegate as suggested by Sergey Surkov in between the imports and the implementation and then adding libstdc++.6.dylib in build phases worked for me. Please also view https://stackoverflow.com/a/27628797/1036945
I've had the exact same problem using the latest SDKs from Parse (1.7.4) and Facebook (4.2.0). The problem is caused by the Bolts.framework included in both Parse and Facebook SDKs. For some reason the Bolts framework in Parse is always newer than the one included in the Facebook SDK.
After many-many attempts at installing, removing and re-installing these SDKs, using the drag and drop method and via Cocoapods, I finally managed to overcome this issue by undertaking the following steps:
I removed completely any instance of the Parse, Facebook and Bolts frameworks from my project;
I re-added the FBSDKCoreKit framework (and the ShareKit and LoginKit for the needs of my project) following the steps on the Facebook developer page: https://developers.facebook.com/docs/ios/getting-started/
Make sure NOT to copy the items to your project.
I re-added the Parse framework to the project using the drag-and-drop method. I also added the ParseFacebookUtilsV4 framework because I needed it to create users via Facebook Login.
This was the most important step that solved everything: I added the Bolts.framework provided by Parse by dragging it to the project, but making sure NOT to copy it to the project (just like with the FBSDKCoreKit framework, I deselected the "Copy items into destination group's folder." option. If you copy it to the project folder, the project won't build.
These steps finally solved all my problems.
if you are using cocoapods try pod update Bolts
EDIT2: FacebookSDK Update 3.23.2 resolves this issue and includes Bolts 1.1.4: https://developers.facebook.com/resources/facebook-ios-sdk-3.23.2.pkg
EDIT:
Drop -ObjC "Other Linker Flag" from your Build settings.
Bolts.framework is not necessary with Parse if Facebook SDK is integrated.
As of Facebook iOS SDK 3.14 bolts.framework is included. https://developers.facebook.com/docs/ios/upgrading-3.x
Try removing your manual instance of bolts.framework.
Just to put the record straight.
The issue is caused because of a conflict with the Bolts framework between the Facebook SDK Bolts and the Parse bolts framework. A temporary solution to get around this issue is to use Cocoapods for your Facebook SDK dependency which will help while a fix is worked on.
The bug has been acknowledged by Facebook & is being assigned to the appropriate team for fixing.
Please follow https://developers.facebook.com/bugs/383331175179417/ for the updates.
make sure the facebook sdk framework and bolts framework (comes with fb sdk) is imported into your project.
i got similar error ("...is not a dylib" and "Undefined symbols for architecture") because i dragged the whole parse folder ("parse-library-1.7.4-2") into my xcode project, when i should have dragged only the frameworks i needed ("Bolts.framework" and "Parse.framework"). deleted the parse folder, dragged over the two frameworks, then everything works as expected :)
I had the exact same problem. Updating Bolts to 1.1.4 solved it for me (Bolts was 1.1.3 before).
If you use cocoapods, change or add this line to your podfile
pod 'Bolts', '1.1.4'
If not, just download it here : https://github.com/BoltsFramework/Bolts-iOS/releases
Try downloading the latest SDK and replacing all of the Parse frameworks with the latest version.

How to properly use Bolts Framework code along with Parse and Facebook?

So,
I am building this iOS 8 app where I am using both Facebook and Parse Frameworks simultaneously. I am aware that Bolts framework is included in the latest Facebook SDK. I am attempting to use BFTasks with Parse code to make it easier to handle async taks, such as the following:
PFQuery *userQuery = [PFUser query];
[[userQuery findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task){
}];
However, including the Facebook and Parse SDKs alone won't let me access the code above via Xcode auto completion. It will even crash if I attempt to run something like the above.
On the other hand, if I try to include the Bolts Framework into the project and import the headers #import <Bolts/Bolts.h>, it will let me access the methods via auto-completion, but Xcode will complain saying that the there are duplicate binaries of the Bolts Framework.
Can anyone explain how to go about this or send me a link on a tutorial or something? I might be overlooking something simple.
Thanks a lot in advance
I was able to get it going using cocoapods. So I installed bolts using cocoapods and then manually added the Parse and Facebook SDK.
I couldn't figure out how to do it otherwise
I was having a problem with linker errors after upgrading to Parse SDK 1.9 -- references included BFTask and multiple references. Also using FB SDK 3.24 and one version using 4.7. Same problem. No cocoapods. I finally resolved it by importing both FB SDK and Bolts from the FB default location -- with no copy files provision AND importing JUST Parse and ParseFacebookUtils frameworks (not their Bolts framework) with the copy files to destination = YES. So - it appears - XCode should access Bolts from the FB SDK location when needed, but NOT see the Parse Bolts framework because Parse has been copied to the app's folder, but the Parse Bolts was not. So no double reference to Bolts. See if this helps.

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)
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!
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>
This worked for me.
1) I deleted the Bolts.framework that came with parse.
2) Added only parse (selecting copy into destination folder) & facebookSDK (unchecking copy into destination folder). Also checked Framework search path in Build Settings.
3) Added NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
in AppDelegate.m before
#interface AppDelegate ()
#end
I know an answer has already been accepted, but this has now been resolved by Facebook.
If you download the latest Parse SDK (1.7.0) and Facebook SDK (4.0.0) as of this writing, it should work just fine. Both SDKs were updated just hours ago.
I have imported and copied Bolts.framework and Parse.framework from the Parse SDK, and then linked to Facebooks SDK (now called FBSDKCoreKit.framework), and it successfully builds the project.
Duplicate question: Parse and facebook sdk -duplicate symbol
Follow these step:
applicatonTarget-> Build Phase-> expend Compile sources.
Here, you need to remove those file that causes duplicate symbol error. Then build again.

Duplicate Symbol SBJSON on iOS Facebook SDK V 3.0

In the current project, I used SBJSON everywhere and got it working fine with the previous version of iOS Facebook SDK since SBJSON was included in Facebook SDK.
I just upgraded to iOS Facebook SDK version 3.0 and having problem with SBJSON.
The first thing it complaint was about NOT finding SBJSON header file. So I thought, I could manually include the SBJSON lib into the project.
After I did that, then the compiler complaint that the SBJSON symbol was duplicated with the Facebook SDK.
I could not find the SBJSON.h anywhere in FB SDK headers.
So at the end, I went into a loop of problems.
Does anyone know how to solve this issue?
The worst case could be that I have to switch to use other JSON library for iOS.
Note: They are using framework for Facebook SDK, not the source code library like before
Cheers
What I ended up using to solve this are two approaches:
The first one
Firstly, not using the pre-built Facebook SDK framework that they
provided
Secondly, check out the Facebook SDK source code from Facebook SDK and integrate it to the project
The second one
Integrate the Json-framework using their source code here and change the name of any duplicate class to something unique to your project like SBJsonParser to MySBJsonParser

Resources