AndrewSB
AndrewSB

Reputation: 951

(Swift) Linker error when trying to use parse 1.7.1 and FacebookSDK 4.0.1

I'm upgrading my iOS project to the new versions of the parse and Facebook SDKs because Swift 1.2 doesn't support older versions.

Now that I've upgraded I can't get rid of a linker error. I've added parse 1.7.1 and removed the import statement from my bridging header. With just parse the compiler did not complain.

But since I use facebook login, I also need to include the FacebookSDK. I've added the facebookSDK 4.0.1 and this is where the problem arises.

I know have 1 warning and 9 errors. Here are the errors

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've tried things like adding the -ObjC linker flag, removing and readding the SDK. Can't think of anything else.

Not sure what to do

Upvotes: 2

Views: 542

Answers (1)

Tal Zion
Tal Zion

Reputation: 6526

I have the same problem. I upgraded to Xcode 6.3 and Swift 1.2. I was importing the Facebook 4.0.1 SDK for the first time with Parse. This is what I tried so far.

  1. I added the SDK libraries FBSDKCoreKit.Framework, FBSDKLoginKit.Framework, FBSDKShareKit.Framework into your XCode Projects Framework folder. Uncheck "Copy into destination group folder" and followed the setup steps with Facebook and Parse.

and added the PFFacebookUtilsV4 library

Then I added the import to my Bridging-Headrer

import FBSDKCoreKit/FBSDKCoreKit.h

import ParseFacebookUtilsV4/PFFacebookUtils.h

Screenshot

I got the same error above from your question.

  1. I came across a solution and deleted all the module folders in the FB SDK which was spouse to bring a solution to importing to Swift projects, and now this is my error

Screenshot

I updated the Parse SDK and still couldn't find a solution. Tried to import the libraries in the AppDelegate.swift and still couldn't do it. Tried accessing the PFFacebookUtils but after adding the FBSDK, Xcode can't find this file.

Thank you for helping..

Upvotes: 1

Related Questions