iosxcodegoogle-play-gamesduplicate-symbol

Google Services - Duplicate symbols on link


I'm getting the google services for ios integrated in my app. For reasons outside my control I can't use cocoapods, so I'm following the manual approach outlined here.

The problem is the Play Games C++ SDK Version 2.1 (gpg.framework). When I add it, (build phases, link binary with libraries, +) and build I get a lot of duplicate symbol errors:

duplicate symbol _AES_decrypt in: ../../../../../Monkey/modules/googleservices/native/gpg-cpp-sdk/ios/gpg.framework/gpg(libgpg.a-arm64-master.o) ../../../../../Monkey/modules/googleservices/native/gpg-cpp-sdk/ios/gpg.framework/gpg(aes.o)

. . .

duplicate symbol __ZTVN4buzz10XmlBuilderE in: ../../../../../Monkey/modules/googleservices/native/gpg-cpp-sdk/ios/gpg.framework/gpg(libgpg.a-arm64-master.o) ../../../../../Monkey/modules/googleservices/native/gpg-cpp-sdk/ios/gpg.framework/gpg(xmlbuilder.o) ld: 7242 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've spent a day going over the common causes for duplicate symbols in stack overflow and nothing seems to work. Removed all google frameworks and re-added them, added the google frameworks in a different project (same issue), cleared out derived data, etc..

Any ideas on what might be causing it? Help much appreciated, thanks.

Specs:


Solution

  • This might not be the best solution, but I solved it by opening up the gpg file, and removing the offending .o files that contained duplicate symbols.

    Followed the instructions here.

    The files I removed are libgpg.a-* and example_mul.o

    Can't guarantee it all works, but at least it's letting me do a google services sign-in at this point.