3

I have an app where first time I used PARSE. Then for second update, client requested GoogleMaps . When setup GMS, it said: " Choose your project, rather than a specific target, and open the Build Settings tab. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All. "

If I set -ObjC to linker flags, I have this kind of errors from parse:

Undefined symbols for architecture i386: "_FBTokenInformationExpirationDateKey", referenced from:

-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationTokenKey", referenced from:

-[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationUserFBIDKey", referenced from:

-[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o) "OBJC_CLASS$_FBAppCall", referenced from:

objc-class-ref in Parse(PFFacebookAuthenticationProvider.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) "OBJC_CLASS$_FBSessionTokenCachingStrategy", referenced from:

_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) "OBJC_METACLASS$_FBSessionTokenCachingStrategy", referenced from:

_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I found a solution to do not add Facebook in app and to use this kind of flag: -force_load

And after using this, I have also error: ld: file not found: clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried different types of using this, like : -force_load - the same error -force_load pathOfFramework/ - the same error

It is possible to give me a solution for this ?

Thanks a lot !

this is first error

Bonnke
  • 896
  • 1
  • 12
  • 24

1 Answers1

9

The problem is that parse has classes that it doesn't load if it doesn't need. For example, it only imports the Facebook classes if FacebookSDK is installed. -ObjC loads all of these, but they are dependent on FacebookSDK. When it can't find the files it needs, it throws errors:

Change:

-ObjC

To:

-force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps

Source: Here

Community
  • 1
  • 1
Logan
  • 52,262
  • 20
  • 99
  • 128
  • 1
    No problem, I had the same problem before! You can use this with any framework that you'd like to avoid -ObjC. It makes it easier to use 3rd party SDK's alongside parse. – Logan May 06 '14 at 16:39
  • using force load causes duplicate symbols... I can't seems to solve this issue. I use xcode 6.3+ and GoogleMaps 1.10.5 (worked with pods on blank project but now I need to make it work with parse without the -ObjC flag) – SKYnine Nov 11 '15 at 16:42