Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Ads Xcode build error

Discussion in 'Unity Ads & User Acquisition' started by hakankaraduman, Jun 4, 2015.

  1. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    Hi, I get this error, I use Unity 5.0.1p4 and Xcode 6.2

    Code (CSharp):
    1. Ld /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Products/Debug-iphoneos/nifah.app/nifah normal armv7
    2.     cd /Volumes/Untitled/CityPark1/ParkProject/ios1
    3.     export IPHONEOS_DEPLOYMENT_TARGET=6.0
    4.     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    5.     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -L/Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Products/Debug-iphoneos -L/Volumes/Untitled/CityPark1/ParkProject/ios1 -L/Volumes/Untitled/CityPark1/ParkProject/ios1/Libraries -F/Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Products/Debug-iphoneos -F/Volumes/Untitled/CityPark1/ParkProject/ios1/UnityAds -F/Volumes/Untitled/CityPark1/ParkProject/ios1/Frameworks/Plugins/iOS -F\"/Volumes/Untitled/CityPark1/ParkProject/ios1/UnityAds\" -F/Volumes/Untitled/GoogleMobileAdsSdkiOS-7.2.2 -filelist /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/nifah.LinkFileList -dead_strip -weak_framework CoreMotion -weak-lSystem -ObjC -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework GoogleMobileAds -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -liPhone-lib -framework UnityAds -framework StoreKit -framework CoreTelephony -framework AdSupport -framework MessageUI -framework EventKit -framework EventKitUI -framework AdSupport -framework CoreTelephony -framework UnityAds -Xlinker -dependency_info -Xlinker /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/nifah_dependency_info.dat -o /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Products/Debug-iphoneos/nifah.app/nifah
    6.  
    7. ld: warning: directory not found for option '-F"/Volumes/Untitled/CityPark1/ParkProject/ios1/UnityAds"'
    8. duplicate symbol _UnityEngine_Cloud_GetAppInstallMode in:
    9.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    10.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    11. duplicate symbol _UnityEngine_Cloud_GetAppVersion in:
    12.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    13.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    14. duplicate symbol _UnityEngine_Cloud_GetBundleIdentifier in:
    15.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    16.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    17. duplicate symbol _UnityEngine_Cloud_IsJailbroken in:
    18.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    19.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    20. duplicate symbol _OBJC_METACLASS_$_UnityEngineCloudUtil in:
    21.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    22.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    23. duplicate symbol _OBJC_CLASS_$_UnityEngineCloudUtil in:
    24.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    25.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    26. duplicate symbol _OBJC_CLASS_$_UnityEngineCloudMobileProvisionUtil in:
    27.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    28.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    29. duplicate symbol _OBJC_METACLASS_$_UnityEngineCloudMobileProvisionUtil in:
    30.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS.o
    31.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-afhotyzddhwwsmcfpupnsprcpbux/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/UnityEngineCloudiOS 1.o
    32. ld: 8 duplicate symbols for architecture armv7
    33. clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  2. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Please update to Unity 5.0.2p4 and Xcode 6.3.2. Also make sure you have the latest version of the Unity Ads asset package in your project, and that your Scripting Backend is set to IL2CPP and Architecture is set to Universal. Then, delete your existing Xcode project before rebuilding it from Unity.

    If that doesn't fix the issue, please attach a screenshot of your Linked Frameworks and Libraries.
     
  3. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    Hi Nikkolai,

    Thanks for the reply. I finally finished downloading Xcode and Unity.

    I started by deleting old Xcode project folders.
    Then I deleted the Unity ads package from Unity project and imported it again (latest version)
    Created a new Xcode build from Unity.

    Still same :(

    I also see that there are 2 UnityAds frameworks are added. I don't remember it was doing that before. I tried deleting either of them in separate Xcode projects and cleaning their references from library but still getting the same type of Mach-O Linker error.

    Code (CSharp):
    1. Ld /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/nifah normal arm64
    2.     cd /Volumes/Untitled/CityPark1/ParkProject/_xcode_1
    3.     export IPHONEOS_DEPLOYMENT_TARGET=6.0
    4.     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    5.     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -L/Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -L/Volumes/Untitled/CityPark1/ParkProject/_xcode_1 -L/Volumes/Untitled/CityPark1/ParkProject/_xcode_1/Libraries -F/Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -F/Volumes/Untitled/CityPark1/ParkProject/_xcode_1/UnityAds -F/Volumes/Untitled/CityPark1/ParkProject/_xcode_1/Frameworks/Plugins/iOS -F\"/Volumes/Untitled/CityPark1/ParkProject/_xcode_1/UnityAds\" -F/Volumes/Untitled/GoogleMobileAdsSdkiOS-7.2.2 -filelist /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/nifah.LinkFileList -dead_strip -weak_framework CoreMotion -weak-lSystem -ObjC -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework GoogleMobileAds -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -liPhone-lib -framework UnityAds -framework StoreKit -framework CoreTelephony -framework AdSupport -framework MessageUI -framework EventKit -framework EventKitUI -framework AdSupport -framework StoreKit -framework CoreTelephony -framework UnityAds -Xlinker -dependency_info -Xlinker /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/nifah_dependency_info.dat -o /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/nifah
    6.  
    7. ld: warning: directory not found for option '-F"/Volumes/Untitled/CityPark1/ParkProject/_xcode_1/UnityAds"'
    8. duplicate symbol _UnityEngine_Cloud_GetAppInstallMode in:
    9.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    10.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    11. duplicate symbol _UnityEngine_Cloud_GetAppVersion in:
    12.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    13.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    14. duplicate symbol _UnityEngine_Cloud_GetBundleIdentifier in:
    15.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    16.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    17. duplicate symbol _UnityEngine_Cloud_IsJailbroken in:
    18.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    19.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    20. duplicate symbol _OBJC_METACLASS_$_UnityEngineCloudUtil in:
    21.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    22.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    23. duplicate symbol _OBJC_CLASS_$_UnityEngineCloudUtil in:
    24.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    25.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    26. duplicate symbol _OBJC_CLASS_$_UnityEngineCloudMobileProvisionUtil in:
    27.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    28.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    29. duplicate symbol _OBJC_METACLASS_$_UnityEngineCloudMobileProvisionUtil in:
    30.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS.o
    31.    /Users/hakan/Library/Developer/Xcode/DerivedData/Unity-iPhone-eoufmxfjoaxkjkgzuabjlbdpmxqu/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/UnityEngineCloudiOS 1.o
    32. ld: 8 duplicate symbols for architecture arm64
    33. clang: error: linker command failed with exit code 1 (use -v to see invocation)
     

    Attached Files:

  4. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    You might have old Unity Ads assets in your project. Try to remove all existing Unity Ads assets before importing the latest Unity Ads asset package.
     
  5. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    In case someone else needs a solution I write down again what I did.

    I completely deleted the Plugins folder and Standard Assets>Editor>Unity Ads and Standard Assets>Unity Ads folders.

    Reinstalled my plugins (Google admob, unity analytics, unity ads and google analytics). and it worked.

    Though It still shows two instances of UnityAds framework in the linked libraries and frameworks section but I don't care, it's working and it's enough.

    Thanks for the help
     
  6. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Thanks for posting.

    The only thing I can think of that might be adding the duplicate framework would be having a second Unity Ads editor script in your project that's being run, or you're appending changes to an existing Xcode project when building.

    Can you share a screenshot of the Frameworks section? Also check in /Assets/Editor for anything Unity Ads related. There shouldn't be anything there. If there is, it's a leftover from a previous Unity Ads asset package and can be removed.