iOs: clang: error: linker command failed with exit code 1

I am getting the following error when building for iOs which seems to be caused by Unity Ads

duplicate symbol _OBJC_CLASS_$_UnityAdsUnityWrapperDelegate in:
    /Users/company/Library/Developer/Xcode/DerivedData/Unity-iPhone-dkvimmfycyxdkfdavlossvwtiguq/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityAdsUnityWrapper-75a0e1861a76234d68641c8057227d60f0004ed65ee5ff27c27446ef2b86d435.o
    /Users/company/Library/Developer/Xcode/DerivedData/Unity-iPhone-dkvimmfycyxdkfdavlossvwtiguq/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityAdsUnityWrapper-75a0e1861a76234d68641c8057227d60213138373d2a4b81e5d2c4e286bbb741.o
duplicate symbol _OBJC_METACLASS_$_UnityAdsUnityWrapperDelegate in:
    /Users/company/Library/Developer/Xcode/DerivedData/Unity-iPhone-dkvimmfycyxdkfdavlossvwtiguq/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityAdsUnityWrapper-75a0e1861a76234d68641c8057227d60f0004ed65ee5ff27c27446ef2b86d435.o
    /Users/company/Library/Developer/Xcode/DerivedData/Unity-iPhone-dkvimmfycyxdkfdavlossvwtiguq/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityAdsUnityWrapper-75a0e1861a76234d68641c8057227d60213138373d2a4b81e5d2c4e286bbb741.o
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Using Unity 2018.3.5f1, Monetization 3.0.1 and Unity IAP asset.

The issue was that although I was using the Monetization asset, the old ‘Unity Ads’ package was included in the package manager by default. Removing this allows it to build successfully.

Can You tell me how to do this, if it’s simple, I’m facing the same issue

Search that duplicate file at xcode.
Select that file.
At right side of your screen, uncheck the ‘Target Membership’ with ‘unity-iphone’.
Build again, your problem must solved with this.

1 Like

This solved my problem, thank you!

Which file do you mean?

Duplicate file errors are typically caused because you have installed the Unity Ads SDK multiple times. This can happen a couple different ways:

  1. If you install from the Services Window and Package Manager. You only need to use one package:
    How should I install Unity Ads in my game ?

  2. You have installed the Unity Ads SDK and installed ads mediation SDK (e.g. MoPub or AdMob). The mediation SDK will also include the Unity Ads SDK, so this will cause a duplication error during a build.

If you still have issues with your build, please create a new forum post and provide as much detail as possible.