Search Unity

Linker command failed with exit code 1

Discussion in 'iOS and tvOS' started by Mr-Tsunami, Nov 20, 2015.

  1. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    83
    Hi guys.

    I'm using Unity 2018.2.15.f1. Our App is an ARFoundation project. My Xcode is 10.1 (10B61). Everything works, but when we used Xcode to post our work to Apple Connect we get the same error:

    linker command failed with exit code 1 (use -v to see invocation)
    clang


    The @smiletastekittens suggested solution didn't work (sadly). Do you have any other suggestions?

    Thanks.
     
    CoCoNutti likes this.
  2. Jonas_Hartmann

    Jonas_Hartmann

    Joined:
    Apr 9, 2018
    Posts:
    4
    We encountered the same problem with our ARFoundation project. We're using preview 20.
     
  3. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    I think I have solved this problem by unchecking Edit -> Project Settings -> ARCore -> Unchecking iOS support enabled.
    I think "ARCore Supported" in Player Settings -> XR Settings could be a source of error.

    My actual settings are these two unchecked and it builds and works.
     
  4. Goodfeel

    Goodfeel

    Joined:
    Oct 27, 2015
    Posts:
    3
    Same error with Unity 2018.2.14f1, Unity 2018.2.17f1 and xCode 10.
    Cut all!!! Ads, Purchase, analitics... All plugins... How to see what the error is? Double click on the error does not provide additional information... New empty project is building... :eek: Heeelp!!!!! Sos!!!!
     
    CoCoNutti likes this.
  5. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    I had this issue when I had installed the latest Ads SDK from here https://assetstore.unity.com/packages/add-ons/services/unity-ads-66123

    .. but also had the Unity.Ads package installed (Package Manager).. which got installed via integrated Ads being enabled in Services.

    Using one or the other should fix this if the clang error is related to Unity Ads.
     
  6. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    I've been away from my project for 2 months and upgraded to latest unity and xcode today (Version 10.1 (10B61))
    I now have an error ONLY when I build to device (tried on both iphone and ipad) but it runs fine on simulator.

    Error is:

    /clang:-1: linker command failed with exit code 1 (use -v to see invocation)

    Any ideas? IPad has plenty of memory, so it's not that. Runs fine in Unity Editor as well.
    I tried the disabling of built-in ads extension and imported from the asset store instead, but this has made no difference.
    (And how do I "use -v to see invocation??)

    Pulling my hair out here!
    Thanks for any help


    EDIT: More info from log:
    Undefined symbols for architecture arm64:

    "_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:

    objc-class-ref in MediaLibraryHandler.o

    "_MPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:

    -[MediaLibraryHandler moviePlayerDidFinishReason:] in MediaLibraryHandler.o

    "_MPMoviePlayerPlaybackDidFinishNotification", referenced from:

    -[MediaLibraryHandler playVideoAtURL:fullscreen:] in MediaLibraryHandler.o

    -[MediaLibraryHandler moviePlayerDidFinishReason:] in MediaLibraryHandler.o

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
    Last edited: Jan 10, 2019
  7. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Did you find a solution?
     
  8. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Are you targeting ARM64 and is that causing the issue?

    https://docs.unity3d.com/Manual/iphone-64bit.html

    Also, you can Right-click the error in the Issue Navigator in xCode - Choose "Reveal in Log" or "Reveal in Project Navigator "and you might see more info about the error...
     
    CoCoNutti likes this.
  9. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513

    Yes the log says:
    "Movieplayer" ??? Only thing i can think of in my app that would need this is UnityAds?
     
  10. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    When I had the issue with Unity Ads, I had to remove the ads package via package manager, turn off ads in services and just have the plugin installed from asset store.. as far as I remember.

    I'll double check the project tomorrow for you. I didnt have movieplayer issue specifically, but it didnt like the multiple unity ads implementations when building in xcode.

    I also remember someone having issue which was due to symlinking when building initial project in unity? Turn that off maybe if its on in ios build settings on mac?
     
  11. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513

    Yes, tried that with the ads but still an issue. Thanks for helping out.
     
  12. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
  13. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    got this error after uninstalling unity ads, reinstalling it didn't help, good I have git =)
     
  14. DigitalBeach

    DigitalBeach

    Joined:
    Jan 17, 2015
    Posts:
    37
    We are having this problem also with a clean import of the ARFoundation, ARKit, ARCore packages in all versions of 2018.3 we have tried. We are forced to set to ARM64 due to ARKit and then it will not link with that set.
     
  15. UselessCookie

    UselessCookie

    Joined:
    Jun 14, 2014
    Posts:
    1
    This fixed the issue for me! I was seeing linker errors regarding IOS specific _share and _medialibrary functions while building in Xcode. I am using "Cross Platform Native Plugins" and it stopped compiling after upgrading the project to a newer Unity version as well as updating Xcode itself.

    Make sure to import the downloaded package from Assets -> Import Package... -> Custom Package

    I also had to set the target minimum IOS version back to 10 in the player settings after increasing that some time ago, seems the native plugins don't work with higher minimum IOS versions.

    Though, I would be glad if Unity could start supporting these system specific features from the C# scripting backend without additional assets or plugins from the asset store. I am using Unity's native IOS reminder notification feature, and it implements well in IOS, so why do we not have other IOS (and Android) system features supported natively yet?
     
  16. Jord445500

    Jord445500

    Joined:
    Feb 13, 2021
    Posts:
    5
    I updated all my native plugins in unity and that seemed to solve it. Hope it helps you too.