ld: 134 duplicate symbols for architecture arm64 on iOSDevice64 when adding third party framework (AdMob)

  

I downloaded the Google Mobile Ads SDK for iOS and extracted it to the frameworks path of the iOS 11 SDK. I then generated pascal headers for it using the SDK Transform Assistant. I added the headers to an empty project and added the linker options -ObjC -lz -lsqlite3 to fix “Undefined symbol” errors. I also had to copy over a few other frameworks using the SDK Manager (dependencies of GoogleMobileAds).

The project runs fine on iOSDevice32 but when building for iOSDevice64 linking fails with the error

[DCC Error] E2597 duplicate symbol l002 in:
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADGestureRecognizer.o)
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADNVideoPlayer.o)
duplicate symbol l002 in:
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADGestureRecognizer.o)
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADNGLSphericalShader.o)
duplicate symbol l004 in:
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADNGLSphericalShader.o)
duplicate symbol l005 in:
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADLocation.o)
C:\Users\Christopher Hahn\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.0.sdk/System/Library/Frameworks/GoogleMobileAds.framework/GoogleMobileAds(GADNGLSphericalShader.o)

etc.

How can I fix this? I am using Delphi 10.2.3 and XCode 9 on OSX 10.13.6 (although I also tried it with XCode 9.2 and 9.4.1 and the corresponding iOS versions)

Comments are closed.