Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse for iOS: Errors when trying to run the app

I've been working with the Parse SDK and I followed the quickstep guide. When I try to run, I get these 8 errors. Any ideas as to why? It looks like something to do with the Facebook part of Parse which I'm not using.

 Undefined symbols for architecture armv7: "_FBTokenInformationTokenKey", referenced from:   -[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)   -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)  "_FBTokenInformationExpirationDateKey", referenced from:   -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in     Parse(PFFacebookTokenCachingStrategy.o)   -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)   -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)  "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:   _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:   _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationUserFBIDKey", referenced from:   -[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)   -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS_$_FBRequest", referenced from:   objc-class-ref in Parse(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS_$_FBSession", referenced from:   objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)  ld: symbol(s) not found for architecture armv7  clang: error: linker command failed with exit code 1 (use -v to see invocation) 
like image 994
Sarabyte Studios Avatar asked Mar 17 '13 03:03

Sarabyte Studios


2 Answers

This is some sort of bug associated with the Parse iOS 1.1.33 release as multiple people are seeing the same errors- myself included.

There are a couple of workarounds-

If you're not using a library which requires the -ObjC linker flag, you can remove -ObjC from your project:

Build Settings > Other Linker Flags > remove -ObjC

or if you are using a library which requires that flag, you can add the Facebook SDK.

Both options will eliminate the errors. Hopefully they fix this as I have no need for the Facebook SDK in my app.

Follow the discussion here:

https://parse.com/questions/cocoapods-incompatibility

like image 184
blueHula Avatar answered Oct 04 '22 19:10

blueHula


Here's a potentially simpler workaround than downloading, compiling, and installing the FB kit which is kind of large and cumbersome. Note that, of course, you won't be able to use any of the FB type functionality in Parse and you will run into severe issues if you trigger any of the Parse code that is expecting to use these dummy symbols. But, if you stay away from them you'll be OK I think. So...

  1. Create an object in your application called FBMissingSymbols

  2. Delete the .h you won't need it

  3. Put this in the .m :

NSString *FBTokenInformationExpirationDateKey = @""; NSString *FBTokenInformationTokenKey = @""; NSString *FBTokenInformationUserFBIDKey = @""; @interface FBAppCall:NSObject @end @implementation FBAppCall @end @interface FBRequest:NSObject @end @implementation FBRequest @end @interface FBSession:NSObject @end @implementation FBSession @end @interface FBSessionTokenCaching:NSObject @end @implementation FBSessionTokenCaching @end @interface FBSessionTokenCachingStrategy:NSObject @end @implementation FBSessionTokenCachingStrategy @end 
like image 28
dbquarrel Avatar answered Oct 04 '22 20:10

dbquarrel