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

Question Yet Another IL2CPP Build Failure

Discussion in 'Windows' started by Reimirno7, Jun 13, 2023.

  1. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    On Unity 2021.3.3f1, windows 10. The following error happened when I tried to build to Windows.

    Tried the following, and still the same error persists:
    - restart computer
    - reimport all asset
    - deleting Bee folder
    - deleting entire Library
    - deleting entire project, refetched from remote
    - checked that all win security updates are installed
    - close off all anti-virus software

    Building a blank project works fine, though.

    Please help! This is stalling us from releasing our product. We were able build before and I do not know since when this starts to show up. There is no way for us to debug as the error message is entirely a black box.

    Code (CSharp):
    1. Internal build system error. BuildProgram exited with code -2147024809.
    2. Old commandline for Library/Bee/artifacts/WinPlayerBuildProgram/u1oik/iq99_le_CodeGen.obj:
    3.   /Oi /FI"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
    4.   /Yu"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
    5.   /Fp"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\pch-c-18064695676769142460.pch" /D_WIN64 /D_AMD64_ /FC
    6.   "D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\UnityEngine.VideoModule_CodeGen.c" /MT /c /bigobj /utf-8
    7.   /cgthreads2 /Ox /Gw /Zo /Oy- /d2ssa-cse- /TC /EHs /GR- /Gy /nologo /GF /Z7 /GS- /W3 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200
    8.   /wd4834 /wd4722 /DUNICODE /D_UNICODE /D_SECURE_SCL=0 /D_ITERATOR_DEBUG_LEVEL=0 /D_HAS_ITERATOR_DEBUGGING=0 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP /DWIN32
    9.   /DWINDOWS /D_WINDOWS /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /DBASELIB_USE_DYNAMICLIBRARY=1 /DIL2CPP_MONO_DEBUGGER_DISABLED /DRUNTIME_IL2CPP
    10.   /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DHAVE_BDWGC_GC /DWINDOWS_SDK_BUILD_VERSION=19041 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE
    11.   /D_SCL_SECURE_NO_DEPRECATE /D_WINSOCK_DEPRECATED_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /I"."
    12.   /I"D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp"
    13.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp"
    14.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Include"
    15.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Platforms\Windows\Include" /I"D:\Programs\VS2022\VC\Tools\MSVC\14.32.31326\include"
    16.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um"
    17.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt"
    18.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt" /Fo"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj"
    19.   /D_HAS_AUTO_PTR_ETC=1 /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /D_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS /Zc:__cplusplus /std:c++17
    20.  
    21. New commandline for Library/Bee/artifacts/WinPlayerBuildProgram/u1oik/iq99_le_CodeGen.obj:
    22.   /Oi /FI"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
    23.   /Yu"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
    24.   /Fp"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\pch-c-18064695676769142460.pch" /D_WIN64 /D_AMD64_ /FC
    25.   "D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\UnityEngine.UIElementsModule_CodeGen.c" /MT /c /bigobj
    26.   /utf-8 /cgthreads2 /Ox /Gw /Zo /Oy- /d2ssa-cse- /TC /EHs /GR- /Gy /nologo /GF /Z7 /GS- /W3 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996
    27.   /wd4200 /wd4834 /wd4722 /DUNICODE /D_UNICODE /D_SECURE_SCL=0 /D_ITERATOR_DEBUG_LEVEL=0 /D_HAS_ITERATOR_DEBUGGING=0 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
    28.   /DWIN32 /DWINDOWS /D_WINDOWS /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /DBASELIB_USE_DYNAMICLIBRARY=1 /DIL2CPP_MONO_DEBUGGER_DISABLED /DRUNTIME_IL2CPP
    29.   /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DHAVE_BDWGC_GC /DWINDOWS_SDK_BUILD_VERSION=19041 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE
    30.   /D_SCL_SECURE_NO_DEPRECATE /D_WINSOCK_DEPRECATED_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /I"."
    31.   /I"D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp"
    32.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp"
    33.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Include"
    34.   /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Platforms\Windows\Include" /I"D:\Programs\VS2022\VC\Tools\MSVC\14.32.31326\include"
    35.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um"
    36.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt"
    37.   /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt" /Fo"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj"
    38.   /D_HAS_AUTO_PTR_ETC=1 /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /D_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS /Zc:__cplusplus /std:c++17
    39. System.ArgumentException: AddAction invocation conflicts with earlier invocation for "Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj": commandLineArguments differ
    40. Previous AddAction was here:
    41. <stack trace disabled - set BEE_DEBUG to '1' to trace the source of a conflict>
    42.  
    43.    at Bee.Core.Backend.<>c__DisplayClass36_0.<AddAction>b__2(String msg)
    44.    at Bee.Core.Backend.AddAction(String actionName, NPath[] targetFiles, NPath[] inputs, String executableStringFor, String[] commandLineArguments, Boolean supportResponseFile, Dictionary`2 environmentVariables, NPath[] rspAndBatchFiles, Boolean allowUnexpectedOutput, Boolean allowUnwrittenOutputFiles, Boolean banContentDigestForInputs, String[] allowedOutputSubstrings, NPath[] unavoidableOutputs, NPath[] targetDirectories, String[] sharedResources, Nullable`1 deleteOutputsBeforeRun, NPath[] filesThatMightBeIncluded, CachingMode cachingMode, NPath[] cachingInputIgnoreList, NPath profilerOutput, String responseFileSeparator)
    45.    at Bee.NativeProgramSupport.CLikeCompiler.SetupInvocation(NPath objectFile, CLikeCompilationUnitInstruction cLikeCompilationUnitInstruction)
    46.    at Bee.NativeProgramSupport.CLikeCompilationUnitInstruction.AddActionFor(NPath objectFile)
    47.    at Bee.NativeProgramSupport.NativeProgram.SetupObjectFilesAndSetupBuiltNativeProgram(String outputFilenameWithoutExtension, NativeProgramConfiguration config, NativeProgramFormat format, ArtifactLocationPolicy artifactLocationPolicy, ObjectFileProductionInstructions[] allUnits, NPath[] additionalObjectFiles, ILibrary[] libraries, NPath[] knownHeaders)
    48.    at Bee.NativeProgramSupport.NativeProgram.SetupSpecificConfigurationImpl(NativeProgramConfiguration config, NativeProgramFormat format, ObjectFileProducer[] objectFileProducers)
    49.    at Bee.NativeProgramSupport.NativeProgram.SetupSpecificConfiguration(NativeProgramConfiguration config, NativeProgramFormat format, ObjectFileProducer[] objectFileProducers)
    50.    at PlayerBuildProgramLibrary.PlayerBuildProgramBase.SetupIl2CppBuild()
    51.    at PlayerBuildProgramLibrary.PlayerBuildProgramBase.SetupPlayerBuild()
    52.    at WinPlayerBuildProgram.WinPlayerBuildProgram.SetupPlayerBuild()
    53.    at PlayerBuildProgramLibrary.PlayerBuildProgramBase.RunBuildProgram()
    54.    at PlayerBuildProgramTypeWrapper.Run(String[] args)
    55.    at Program.Main(String[] args)
    56. UnityEditor.GenericMenu:CatchMenu (object,string[],int)
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,500
    Did you try the latest 2021 lts already? There have been many IL2CPP bug fixes made
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,524
    Yeah please upgrade to the newest Unity 2021.3.x build. Looks like this is a hash collision between two object file names - moving your project to another directory will likely work around it too. But I believe we have fixed it since.
     
  4. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    Ty. After upgrading + moving project to another dir I can successfully build now.
     
    DevDunk likes this.
  5. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    What is causing the hash collision? purely bad luck?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,524
    A combination of bad luck + a not great hash algorithm. Basically the two command lines hashed to the same exact string, and we used it as the output path. And then the buildsystem realized that we're trying to compile two files into the same output on disk and errored out.
     
  7. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    Can confirm:

    - moving project to another place resolves this issue (rehash)
    - using the latest version (for me, 3.27f1) resolves the issue.

    IL2CPP builds now.