9
votes

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!)

3
Thanks but I have seen that and nothing suggested there seems to solve my issue. - Richard Shergold
have you included facebook sdk also ? - Dalvik
yes, I have followed all the instructions - including those on the Facebook site. So basically I have downloaded the Parse SDK and dragged Bolts, Parse, ParseFacebookUtils and ParseFacebookUtilsV4 frameworks into the project and then downloaded the Facebook SDK and dragged the FBSDCoreKit framework in. That's what the docs tell me to do, - Richard Shergold
I seem to have solved it by clearing everything out and adding the libraries again. Weird because I had tried this twice already but this time it looks like it may have worked - thanks. - Richard Shergold

3 Answers

37
votes

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

8
votes

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.

0
votes

I have solved this issue using Akram's answer.Here is what i exactly did In a simple way id did this in my Podfile.

pod 'Parse'
pod 'ParseFacebookUtilsV4'  
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'

Note : Remove other frameworks if you have manually added for parse integration.