Using Parse and Google Maps in the same app - conflict at linker flags -- iOS 7.1, Xcode 5.1

StackOverflow https://stackoverflow.com/questions/23479714

  •  16-07-2023
  •  | 
  •  

Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top