Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5.1 - XCode 7 [xcode] clang: error: linker command failed with exit code 1 ...

Discussion in 'iOS and tvOS' started by bsmith, Jul 17, 2015.

  1. bsmith

    bsmith

    Joined:
    Oct 26, 2014
    Posts:
    9
    There is this error I get when I try and build for iOS 9 using XCode 7 and Unity 5.1.1.

    [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)


    I even created a new project and still failed to build.
     
    Lasyin likes this.
  2. kar9a

    kar9a

    Joined:
    Jul 27, 2015
    Posts:
    2
    I have finished "space shooter" tutorial and build was successful. But when I tried it on Xcode things doesn't work. I get the same message at the end of 241 issues... I use iOS 9, Xcode 7 Beta and Unity 5.1.2p1
     
  3. Lasyin

    Lasyin

    Joined:
    Jul 14, 2015
    Posts:
    11
    Having the same issues, the errors said something about enabling bitcode? Im not entirely sure what it means.

    ld: '/Users/*MYNAME*/Desktop/Unity Projects/TESTRUN/TESTRUN1/Libraries/libiPhone-lib.a(LibEntryPoint.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7

    NOTE: This error happened when I updated to Xcode beta 4, building to ios worked in xcode beta 3 for me, so this is a brand new issue!
     
    bsmith likes this.
  4. bsmith

    bsmith

    Joined:
    Oct 26, 2014
    Posts:
    9
    I am in beta 3, but I also read that the build code should already be enabled. I still haven't found a fix either.
     
  5. fredsmalley

    fredsmalley

    Joined:
    Aug 6, 2015
    Posts:
    2
    I have the exact same issue in Xcode 7 beta 4 with Unity 5.1.2f1
     
    bsmith likes this.
  6. B-Train

    B-Train

    Joined:
    Aug 7, 2015
    Posts:
    1
    You can use Xcode 7 beta 4, just disable bitcode for now.

    In Xcode, select the folder view in the left pane top menu and select your project in the left pane, then in the menu above the main panel, select Build Settings and scroll down to Build Options. Set Bitcode Enabled to NO.

    I'm running Unity 5.1.2f1 on a macbook with Xcode Version 7.0 beta 4 (7A165t)
     
  7. fredsmalley

    fredsmalley

    Joined:
    Aug 6, 2015
    Posts:
    2
    Thanks, this got me up and running.
     
  8. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    I get the same thing.
     
  9. dkjunior

    dkjunior

    Joined:
    Aug 1, 2015
    Posts:
    1
    You can disable Bitcode in Build Settings -> Build Options in xCode. Also, it is disabled automatically as of Unity 5.2:
    • iOS: Xcode 7 build failures worked around by disabling Bitcode. Bitcode support will come later
    https://unity3d.com/unity/whats-new/unity-5.2
     
  10. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    When I disable Bitcode, it gives me 13 new errors, plus the same "Linker Command Failed" error.
     
  11. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    What are those errors? I disabled bitcode and it just started working... do you have third party libraries that might depend on it? Perhaps option #2 (contact vendor) is what you need?
     
  12. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    I have Unity Ads - it says that the unityads.framework does not have bitcode.

    So then I deleted Unity Ads.framework from the library, and it gave me another linker command error, this time for libEntryPoint.o. So then I deleted libEntryPoint.o, and I got about 120 errors XD.
     
  13. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    Er, did you JUST turn off bitcode, as in like not deleting any libraries that your app is binding to? That should work...
     
  14. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    In Project Build Settings, I turned Enable Bitcode to NO.

    So, yes to your question.
     
  15. Mage-Co

    Mage-Co

    Joined:
    Jul 1, 2014
    Posts:
    13
    I have the facebook error after I add -fno-objc-arc - to FbUnityInterface.mm new error appear as

    "Cannot specify -o when generating multiple output files"

    Anyone know the solution I try to search but can not find. Thanks
     
  16. JBrantley

    JBrantley

    Joined:
    Feb 4, 2015
    Posts:
    2
    Hey, I'm having the same issue as well. When I disable bitcode I get 115 errors and all of them are "Undefined symbols
    architecture for armv7/arm64" It depends if I'm building for 32 or 64. I can give someone the console log if that helps. I just got a couple of projects backed up in my pipeline because of bitcode....
     
  17. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    Apple states that you must have ENABLE_BITCODE turned on so that they can optimize your app when submitting to iTunes
     
  18. fischaelameer

    fischaelameer

    Joined:
    Feb 19, 2015
    Posts:
    1
    I am having the same problems. Is there any update on this issue?
     
  19. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    I was able to do it. Build your game to XCode. Set the "Team", and then set Enabled Bitcode to NO in the "Target" build, NOT THE PROJECT BUILD. It should work ;)
     
  20. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    @ExbowFTW It works, but that's not the issue. . The issue is that you WANT to enable bitcode since it optimizes your app further, by apple.
     
  21. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    It's a problem with the Unity Ads Framework that you have to set ENABLE BITCODE to "No". In the latest patches of Unity, Unity automatically sets Enabled Bitcode for you to No, which is a new thing.

    I'm pretty sure there is no other way. I mean, they can't optimize your app further, but at least you get the app on the App Store.
     
  22. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    same problem here! but im using windows pc is it possible to fix it?? need help pls
     
  23. AvatarEP

    AvatarEP

    Joined:
    Feb 11, 2016
    Posts:
    8
    This is s new issue but similar about XCODE help? Maybe I should post under VR?

    Used Vuforia and Unity 5.3.1f1p3 (best version for AR with Vuforia according to boards here).

    See attached when published to XCODE...It works perfectly in Unity without errors? Gee...this was suppose to be so simple.

    Any help of what to do with this code error list?
     

    Attached Files:

  24. Ahegde

    Ahegde

    Joined:
    Mar 16, 2016
    Posts:
    3
    I have just downloaded Xcode 7.3 beta 5 and getting the
    linker command failed with exit code 1 (use -v to see invocation). I tried to disable the bitcode but i cant find bitcode in build settings. i have checked and rechecked but its just not there!
    If i save any new file to my project it wont run.
    any help will be much appreciated.
     
  25. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    There is no need to check and recheck: if you type 'bitcode' in the search field (upper right corner of Build Settings panel) it should be the only item visible.
     
  26. Ahegde

    Ahegde

    Joined:
    Mar 16, 2016
    Posts:
    3
    That is the first thing i tried. It came up empty! Then i checked in the build options again. I do not see Enable bitcode.
    I am new to Xcode so not sure if i am missing something here.
     
  27. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    First of all, I would recommend getting a more "stable" version of XCode. XCode is very complicated, and even more so when it's in beta because of bugs, etc. Get a Release version of XCode.
     
  28. Ahegde

    Ahegde

    Joined:
    Mar 16, 2016
    Posts:
    3
    I had xcode 7.2 before (for two weeks) and had the same problem. Then i downloaded the new beta version. I cannot save any new file and run it. I am currently running all the programs i am learning on main.c
    Any new file i try to save comes up with linker command failed with exit code 1 (use -v to see invocation).
     
  29. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    Just a heads-up for everybody encountering this problem. Reporting it like the above is NOT helpful. Look above and/or below that line and try to suss out what the problem is. It will likely be one of the following:

    - symbol not found (and what module was looking for it)
    - duplicate symbol found (and what two or more modules contain it)
    - unable to open library or framework (and what the library name was)

    THOSE error lines are the ones that are going to help you solve the problem.

    As for the bitcode problem, you definitely still need to turn it OFF, and it can randomly be turned back on with subsequent builds, depending on how you emit the XCode projects and what parts of your game you updated between builds.
     
  30. ExbowFTW

    ExbowFTW

    Joined:
    May 2, 2015
    Posts:
    281
    What version of Unity are you using?
     
  31. nastasache

    nastasache

    Joined:
    Jan 2, 2012
    Posts:
    74
    I have Xcode 7.3, Unity 5.3.4. What I am doing wrong? Setting Bitcode to NO looks doing nothing regarding Vuforia.
     

    Attached Files: