Parse for iOS: Errors when trying to run the app

IosParse Platform

Ios Problem Overview


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)

Ios Solutions


Solution 1 - Ios

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

Solution 2 - Ios

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

Solution 3 - Ios

You have to delete the old ParseFacebookUtils.framework and keep the new ParseFacebookUtilsV4.framework to get it working.

Solution 4 - Ios

I loved dbquarrel's answer, but it doesn't work anymore because it is lacking some new social classes.

So do the same thing, but instead, add this:

NSString *FBTokenInformationExpirationDateKey = @"";
NSString *FBTokenInformationTokenKey = @"";
NSString *FBTokenInformationUserFBIDKey = @"";
NSString *SLServiceTypeTwitter = @"";
NSString *ACAccountTypeIdentifierTwitter = @"";
@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
@interface ACAccountStore:NSObject
@end
@implementation ACAccountStore
@end
@interface SLRequest:NSObject
@end
@implementation SLRequest
@end
@interface SLComposeViewController:NSObject
@end
@implementation SLComposeViewController
@end

Solution 5 - Ios

Check and make sure that you do not have two versions of the "ParseFacebookUtils" framework added there is:

ParseFacebookUtilsV4 and ParseFacebookUtils

Once I removed ParseFacebookUtils, and kept ParseFacebookUtilsV4 it worked fine.

Solution 6 - Ios

My Solution will definitely work and you can use -ObjC in other linker flags.

  1. Add "Social.framework" , "Account.framework"
  2. Add "FacebookSDK.framework"

Cheers....now it works..... and no need of removing -ObjC.

Solution 7 - Ios

Sounds like you might need to add the 'Accounts.Framework' and/or the 'Social.Framework'.

Solution 8 - Ios

A complementary to the answer by @blueHula . Parse has removed Facebook SDK from its framework, meaning that from some certain version (1.1.33 maybe) integrating parse.framework should be accompanied by integrating FB SDK independently.

Please refer to this link using the parse ios sdk without including the facebook sdk

The key point is to use -force_load $(SRCROOT)/path/libname.a to link with necessary third-party libraries, rather than using -all_load and -ObjC

Solution 9 - Ios

It is a linker error... You are not including a needed framework in your project which you are referencing in one of you included header files.

So, for example, if you an have an include in your code:

#import <Parse/Parse.h>

It probably requires a supporting framework, and you have to include it in your app. Did you include the parse.framework from within Xcode?

Xcode Frameworks

Solution 10 - Ios

I had the same use and and the only third party I had was the PayPal SDK. After removing -ObjC everything built fine. (always make a backup of you project before changing settings)

Solution 11 - Ios

it's 2015 and I just had the same error. Unfortunately, none of the above answers worked for me. But this did:

Target > Build Phases > Link Binary With Libraries then add libstdc++.6.dylib

This solved the problem for me.

Solution 12 - Ios

There are many frameworks that needs to set -ObjC flag as Other linked flag, whereas Parse do not allow you to proceed if you do so. To deal with this you can do one of following things. I have shown example of Google Maps SDK that needs -ObjC flag, but due to Parse in the same project I can not use it directly:

Solution 1 - Using force_load Flag

Instead of setting -ObjC flag as Other linked flag, use force_load flag to load particular framework or library.

-force_load $(SRCROOT)/GoogleMaps.framework/Versions/A/GoogleMaps

Solution 2 - Using Facebook SDK

Just Add Facebook SDK as a separate framework, this will allow you to use -ObjC flag. Also make sure you have added Accounts.framework and Social.framework. If you have added Bolt.framework and using Parse blank project then to deal with duplicate symbol remove Bolt.framwork. If still it have few errors then remove Accounts and Social framework and Add it again (This will be the case if you have used Parse default blank project).

Solution 13 - Ios

I was bothered this issue for many days. I used cocoapods to manage all of third SDK.

Here is how I resolved this issue. Go to pod project and set the item "build architecture only" to NO.

Rebuild pod project and then link errors is gone! help this can help someone who is using cocoapods.enter image description here

Solution 14 - Ios

I had the same problem. I solved by downloading the previous version (1.1.32) from here:

https://parse.com/downloads/ios/parse-library/1.1.32

(In my case I needed the -ObjC flag)

Edit: It seems that version doesn't work with 64 bit architectures.

Solution 15 - Ios

This can be removed from the project-file located in <projectname>/cordova/<projectname>/platforms/ios/<projectname>.xcodeproj/project.pbxproj and

Search the file for -ObjC, there are multiple locations. It looks like this:

OTHER_LDFLAGS = (
	"-weak_framework",
	CoreFoundation,
	"-weak_framework",
	UIKit,
	"-weak_framework",
	AVFoundation,
	"-weak_framework",
	CoreMedia,
	"-weak-lSystem",
	"-force_load",
	"\"$(BUILT_PRODUCTS_DIR)/libCordova.a\"",
    "-ObjC",
);

Solution 16 - Ios

Install cocoaPods and add this to your Podfile:

pod 'Facebook-iOS-SDK'
pod 'Parse'
pod 'ParseFacebookUtils'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSarabyte StudiosView Question on Stackoverflow
Solution 1 - IosblueHulaView Answer on Stackoverflow
Solution 2 - IosdbquarrelView Answer on Stackoverflow
Solution 3 - IosMarco MartignoneView Answer on Stackoverflow
Solution 4 - IosNate LeeView Answer on Stackoverflow
Solution 5 - IosewakenedView Answer on Stackoverflow
Solution 6 - IosBiranchiView Answer on Stackoverflow
Solution 7 - IosPeteView Answer on Stackoverflow
Solution 8 - IosBabyPandaView Answer on Stackoverflow
Solution 9 - IosryebreadView Answer on Stackoverflow
Solution 10 - IosMarcio ArantesView Answer on Stackoverflow
Solution 11 - IosAlan ScarpaView Answer on Stackoverflow
Solution 12 - IosMrugView Answer on Stackoverflow
Solution 13 - IosG-PowerView Answer on Stackoverflow
Solution 14 - IosjomaferView Answer on Stackoverflow
Solution 15 - IosGustavView Answer on Stackoverflow
Solution 16 - IossbastidasrView Answer on Stackoverflow