Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linker error trying use the Facebook SDK with Parse

I've seen similar questions on this but cannot find an answer. I need to use the Facebook SDK with Parse. I am using the very latest Parse SDK and the very latest Facebook SDK. I have followed the instructions on Parse.com on using Facebook with Parse very closely which means I have dragged the Parse AND Bolts frameworks into my project.
When I build my project I get a Linking error:

Undefined symbols for architecture x86_64: "_FBTokenInformationExpirationDateKey", referenced from: -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationTokenKey", referenced from: -[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationUserFBIDKey", referenced from: -[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS_$_FBAppCall", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBRequest", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSession", referenced from: objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from: _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o) "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from: _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.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 have tried having -ObjC in my Link Flags under Project settings and it makes no difference either way. Does anyone know how I can get round this?

I did look at this post

Parse for iOS: Errors when trying to run the app

but nothing suggested there worked for me (I need the Facebook functionality in my app so I can't bypass it and I have trued the -ObjC flag thing and also the Accounts and Social frameworks thing - nothing gets rid of my error!)

like image 881
Richard Shergold Avatar asked Apr 15 '15 09:04

Richard Shergold


2 Answers

I had the same error, just make sure you delete ParseFacebookUtils.framework library from your project and keep only ParseFacebookUtilsV4.framework.

like image 68
Akram Avatar answered Oct 22 '22 02:10

Akram


I also had the same error. This is what I did to fix it ...

I deleted all of the existing Parse frameworks from my project. I was using Parse version 1.6.1 frameworks from January 2015. This included:

  • Bolts
  • Parse
  • ParseCrashReporting
  • ParseFacebookUtils
  • ParseUI

After deleting those, I downloaded the latest Parse SDK (1.7.4), and then did a drag-and-drop of these frameworks into my project:

  • Bolts
  • Parse
  • ParseCrashReporting
  • ParseFacebookUtilsV4 <––– notice the V4
  • ParseUI

Then I downloaded the latest & greatest FacebookSDK (FacebookSDKs-iOS-20150528.pkg), and did a drag-and-drop of these frameworks into my project:

  • FBSDKCoreKit
  • FBSDKLoginKit
  • FBSDKShareKit

Everything seems to work now. Note that I am linking Accounts.framework and Social.framework, and I am not using the -ObjC flag.

like image 36
Phillip Harris Avatar answered Oct 22 '22 00:10

Phillip Harris