Search Unity

"ld: could not reparse bitcode bundle" on iOS builds

Discussion in 'Unity Build Automation' started by SomeCode, Apr 28, 2019.

  1. SomeCode

    SomeCode

    Joined:
    Jul 5, 2013
    Posts:
    32
    Description of issue:

    Hey guys. Seemingly out of nowhere, our iOS cloud builds have been failing with the following error message:

    10457: ▸ ❌; ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1001.0.46.3.0_0' Reader: '1000.11.45.5_0')', using libLTO version 'LLVM version 10.0.0, (clang-1000.11.45.5)' for architecture armv7
    10458: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)


    On the first instance of this failure, another iOS cloud build config on the exact same hash succeeded, but from that point forward, each build has failed with the above message after "Unity Finished exporting player successfully" has been output and what seems to be during the Linking process.

    I'm not sure where to begin in diagnosing the error. It doesn't seem to be tied to a particular commit - changing the config's branch to an older, previously succeeding commit will fail, and even triggering rebuilds on configs for older hashes that were succeeding now also fail.

    Google tells me that the error is usually associated with using an outdated version of XCode to build, but our builds are set to Latest Compatible Version and have been building with XCode 10.1.

    Any insight would be greatly appreciated! It seems that builds started to fail about three days ago on April 25th. Our configs are set to use the Latest Unity 2018.3 build. If any other info would be helpful, please let me know.

    ----

    Unity version: Unity 2018.3.7

    XCode version: 10.1

    Source control: Git

    Local build platform: OSX / Windows

    Build target: iOS

    Relevant plugins being used:
    Google Play Games
    Playfab
    Lunar Console
    Cinemachine
    TextMesh Pro
    UPM Git Extension
    Unity Ads
    Probably more...

    Project name: -

    Build log (relevant chunk):
    10457: ▸ ❌; ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1001.0.46.3.0_0' Reader: '1000.11.45.5_0')', using libLTO version 'LLVM version 10.0.0, (clang-1000.11.45.5)' for architecture armv7
    10458: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)


    Does it build locally from a fresh checkout?: Yes

    EDIT: Conforming to posting template
     
    Last edited: Apr 29, 2019
  2. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Hello. We are facing the same issue, with the same values in Producer and Reader numbers. Local builds work as expected. Did you manage to solve this?
     
    Last edited: May 10, 2019
  3. kirilledelman

    kirilledelman

    Joined:
    Mar 3, 2017
    Posts:
    1
    Same problem here.

    Workaround is to set "Enable Bitcode" to "No" in XCode project Build Settings.
     
    monoganog and rsodre like this.
  4. Nik_Kov

    Nik_Kov

    Joined:
    Nov 30, 2018
    Posts:
    3
  5. DanielSuperKing

    DanielSuperKing

    Joined:
    Mar 26, 2019
    Posts:
    11
    I don't know if you guys ever solved this... but it looks like your "producer" is XCode 10.2

    Check out this link which shows which version of the LLVM C compiler goes with which XCode.
    https://gist.github.com/yamaya/2924292


    # Xcode 10.1 (10B61)
    Apple LLVM version 10.0.0 (clang-1000.11.45.5)

    # Xcode 10.2 (10E125)
    Apple LLVM version 10.0.1 (clang-1001.0.46.3)

    I'm having the same problem with Jenkins builds where the build machine is on 10.1 but the "producer" all of a sudden is either 10.2.1 or 10.3

    The only think I can think of that is different is switch over to a new macbook, and installed a newer version of XCode than what was on the old machine, but I can't figure out why that would affect Jenkins because nowhere can I find a reference to XCode version that was pushed to the project git repo.

    Don't know how much this actually helps, or if you're still having this problem.
     
    rocket5tim likes this.
  6. John1515

    John1515

    Joined:
    Nov 29, 2012
    Posts:
    249
    Edit: probably out of date Xcode..

    I'm now experiencing this with Unity 2019.4.3, Xcode 11.2.1. Sure it works if I switch off bitcode for the UnityFramework but that doesn't seem right...

    ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1103.0.32.62.0_0' Reader: '1100.0.33.12_0')', using libLTO version 'LLVM version 11.0.0, (clang-1100.0.33.12)' for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  7. sebplus

    sebplus

    Joined:
    Mar 7, 2018
    Posts:
    4
    Same here, with Unity 2020.1.0b12 and Xcode 11.3.1:

    ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1103.0.32.29.0_0' Reader: '1100.0.33.17_0')', using libLTO version 'LLVM version 11.0.0, (clang-1100.0.33.17)' for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
    Last edited: Jul 14, 2020
  8. Numa

    Numa

    Joined:
    Oct 7, 2014
    Posts:
    100
    This means your project contains a library that was built with a more recent version of xcode.
    For example Producer: '1103.0.32.29.0_0' Reader: '1100.0.33.17_0'
    Means this particular library was built with xcode 11.03 but you are currently using xcode 11.00 to build your project

    Update (or install side-by-side) xcode to be 11.03 or greater and it should build fine.
     
    Vaitor likes this.
  9. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    Same here with Unity 2019.4.4 and Xcode 11.6
    How it can be possible if my Xcode is the latest?
     
  10. Numa

    Numa

    Joined:
    Oct 7, 2014
    Posts:
    100
    Producer: '1200. makes me think this could have been built with the beta version of xcode 12 (available on the apple developer portal, I think you need to be a paying member to download it)
     
  11. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    I wonder what a stupid man could publish a plugin created with beta version of Xcode? And the most important thing - how I can get to know what plugin causes this issue? I can download Xcode 12, but I can’t send my app to the AppStore builded with beta version, so it’s useless.
     
    Saicopate likes this.
  12. Dalton-Lima

    Dalton-Lima

    Joined:
    Dec 21, 2016
    Posts:
    19
    Well, I get your frustration, but it may have its use.
    I run (again) into this problem today.

    By using ARFoundation 4.1.0 preview 6, I was relying on some feature that was available in iOS 14 beta, thus needing XCode 12 beta to build it.

    I understand the frustration as this error is not so clear by XCode and Unity also didn't warn us that. I had to read through a lot to get an idea of what library was responsible, even though I had a similar problem before.

    A solution in my case was to rollback ARFoundation for the moment.
    I could compile with XCode Beta, and that worked, still in this case only for Beta testing on TestFlight. It could be useful if you want to test an exclusive new feature before the release.
     
    AytoMaximo likes this.
  13. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    Thanks, that's exactly what it is! I had ARFoundation 4.1.0 preview 5 in my project, but not because of new features. I faced some ARKit crashes on 4.0.2, so I had a hope that a newer version works better. Fortunately, I can rollback to 4.0.2, because I gave up on ARKit Collaboration (problem guy indeed) and using only Image Recognition feature now.
     
    Dalton-Lima likes this.
  14. konsnos

    konsnos

    Joined:
    Feb 13, 2012
    Posts:
    121
    I get this error with ARFoundation 4.0.2 and Unity 2019.4.8f1.

    Which Unity version are you using?
     
  15. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    2019.4.4
     
  16. glaksmono

    glaksmono

    Joined:
    Nov 19, 2020
    Posts:
    21
    Does anyone got this worked out?
     
  17. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Getting this on archive with Unity 2019.4.19f1 and XCode 12.4
     
  18. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    This means one of your 3rd party assets were built using a higher version number of XCode (“Producer”) than the XCode you’re trying to artchive with (“Reader”). However, it gives no hint which asset is it. Installing the latest XCode would solve it. If that’s not possible (eg. it requires upgrading to OSX version that’s not compatible with your mac), then you need to find the offending asset by trial and error (remove one asset, build, archive again etc) and downgrade it to an older version that was built with an older XCode. Very time-consuming. My Mac is too old, Monterey has no support for it so I'm stuck on Big Sur which means I can't upgrade above XCode 13.2. In my case the culprit was Google Mobile Ads, I've downgraded it to an older version and I can finally archive and upload. But I guess it's time for me to buy a new Mac.
     
    DarkoJovic likes this.
  19. grmmt

    grmmt

    Joined:
    Oct 25, 2015
    Posts:
    6
    you downgraded to what version?
     
  20. FunInfused

    FunInfused

    Joined:
    Jun 16, 2021
    Posts:
    16
    I'm running into this now from the Unity Build Automation. I can't fix this by changing XCode settings because this isn't happening from XCode.

    If one of my libraries would built with the wrong version, is there a way to easily tell which one it is?
     
    Last edited: May 14, 2023