9

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

Community
  • 1
  • 1
Richard Shergold
  • 572
  • 1
  • 8
  • 21
  • possible duplicate of [Parse for iOS: Errors when trying to run the app](http://stackoverflow.com/questions/15457136/parse-for-ios-errors-when-trying-to-run-the-app) – Shai Apr 15 '15 at 09:55
  • Thanks but I have seen that and nothing suggested there seems to solve my issue. – Richard Shergold Apr 15 '15 at 10:12
  • have you included facebook sdk also ? – Rahul Apr 15 '15 at 10:19
  • 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 Apr 15 '15 at 10:27
  • You are getting these errors because The farmeworks you included have some missing files..Have You checked on "Copy Files if needed" during dragging and droping. – Rahul Apr 15 '15 at 10:29
  • 1
    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 Apr 15 '15 at 10:53
  • @Bhavin: please note that inline code spans (`like this`) are not for highlighting, only code in sentences. Also, only use formatting when absolutely necessary. See [When should code formatting be used for non-code text?](http://meta.stackoverflow.com/q/254990/2074608) for more information. Thanks! – Qantas 94 Heavy Apr 16 '15 at 10:36
  • Im having the same issue and just cant resolve it. Richard, did you add the FBSDKLoginKit ? – Cliffordwh Apr 16 '15 at 10:42

3 Answers3

37

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

Taifun
  • 6,165
  • 17
  • 60
  • 188
Akram
  • 521
  • 4
  • 4
  • 3
    Worked for me, Thanks. But I also added FBSDKCoreKit', 'FBSDKLoginKit', and 'FBSDKShareKit' pods. – Thein May 13 '15 at 03:08
  • @Akram That's exactly what I did and it worked for me too! Thank you very much. Just out of curiosity, what was the cause of this error? – Septronic Aug 07 '15 at 23:11
8

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

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.

Logic
  • 705
  • 1
  • 9
  • 27