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

Error building for iOS simulator with Unity 5.3.0 and Xcode 7.1 (7B91b)

Discussion in 'iOS and tvOS' started by Gayton, Dec 9, 2015.

  1. Gayton

    Gayton

    Joined:
    Dec 9, 2015
    Posts:
    3
    I am using Unity 5.3.0f4 (and earlier 5.2.3) followed by Xcode 7.1 (7B91b), to build for iOS simulator. When building in Xcode, I get this error:

    "ld: in /Uesrs/<path-to-my-build>/iOS/Libraries/libiPhone-lib.a(asmassembly.o), building for iOS simulator, but linking in object file built for OSX, for architecture x86_64"

    Looking into this I found that the libiPhone-lib.a library contains code which was compiled for MacOSX. A new feature for Xcode 7 asserts that the platform flag contained in the library matches the target platform. For some reason identical code generated for the same architecture, but for a different platform (simulator vs. macosx) triggers this assert. Using the command line tool, otool, on my copy of libiPhone-lib.a, id do see quite a few references to: LC_VERSION_MIN_MACOSX.

    I found more information on this site: https://karp.id.au/post/xcode_7_linker_rules/
     
    FakiNyan and Ted24 like this.
  2. FakiNyan

    FakiNyan

    Joined:
    Mar 4, 2015
    Posts:
    4
    Hello, I got the same error. Have you found solution?
     
  3. Gayton

    Gayton

    Joined:
    Dec 9, 2015
    Posts:
    3
    I have tried using the command line tool, lipo, to turn the libiPhone-lib.a fat archive into just an x86_64 archive, then use the ar tool's extract option to split the archive into *.o files. I wrote a tool myself to parse the *.o files and switch the LC_VERSION_MIN_MACOSX load commands to LC_VERSION_MIN_IPHONEOS. Then recombined the *.o files into a new libiPhone-lib.a file only to find that although it does fix the link error, when I run I get errors due to undefined symbols. So, it seems the problem may be more complicated.
     
    FakiNyan likes this.
  4. MohHeader

    MohHeader

    Joined:
    Aug 12, 2015
    Posts:
    41
    Same issue here with Xcode 7.0 :(
     
  5. HatchDev

    HatchDev

    Joined:
    Sep 7, 2015
    Posts:
    5
    I am having the same issue with building for iOS. It is completely broken and no amount of target iOS versions switching seems to help. I think it has to do with the Open GL support of older iOS devices and their ability to render Unity's new standard Open GL 4.1 standard.
    Not being able to publish to my primary target is very inconvenient and unlike Unity. Not to mention the engine crashes 10X per hour since the update.
     
  6. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Hello, the simulator regression has been fixed; the fix will appear in Unity 5.3.1.
     
  7. talgif

    talgif

    Joined:
    Dec 11, 2012
    Posts:
    3
    I have unity 5.3.1 and this problem is still appearing