Yet Another IL2CPP Build Failure

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.

Internal build system error. BuildProgram exited with code -2147024809.
Old commandline for Library/Bee/artifacts/WinPlayerBuildProgram/u1oik/iq99_le_CodeGen.obj:
  /Oi /FI"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
  /Yu"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
  /Fp"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\pch-c-18064695676769142460.pch" /D_WIN64 /D_AMD64_ /FC
  "D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\UnityEngine.VideoModule_CodeGen.c" /MT /c /bigobj /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 /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 /DWIN32
  /DWINDOWS /D_WINDOWS /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /DBASELIB_USE_DYNAMICLIBRARY=1 /DIL2CPP_MONO_DEBUGGER_DISABLED /DRUNTIME_IL2CPP
  /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DHAVE_BDWGC_GC /DWINDOWS_SDK_BUILD_VERSION=19041 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE
  /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"."
  /I"D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp"
  /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp"
  /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Include"
  /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"
  /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"
  /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"
  /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt" /Fo"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj"
  /D_HAS_AUTO_PTR_ETC=1 /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /D_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS /Zc:__cplusplus /std:c++17

New commandline for Library/Bee/artifacts/WinPlayerBuildProgram/u1oik/iq99_le_CodeGen.obj:
  /Oi /FI"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
  /Yu"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch\pch-c.h"
  /Fp"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\pch-c-18064695676769142460.pch" /D_WIN64 /D_AMD64_ /FC
  "D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\UnityEngine.UIElementsModule_CodeGen.c" /MT /c /bigobj
  /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
  /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
  /DWIN32 /DWINDOWS /D_WINDOWS /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /DBASELIB_USE_DYNAMICLIBRARY=1 /DIL2CPP_MONO_DEBUGGER_DISABLED /DRUNTIME_IL2CPP
  /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DHAVE_BDWGC_GC /DWINDOWS_SDK_BUILD_VERSION=19041 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE
  /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"."
  /I"D:\MyFiles\Projects\Unity_Projects\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp"
  /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\libil2cpp"
  /I"D:\Programs\UnityEditor\2021.3.3f1\Editor\Data\il2cpp\external\baselib\Include"
  /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"
  /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"
  /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"
  /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt" /Fo"Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj"
  /D_HAS_AUTO_PTR_ETC=1 /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /D_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS /Zc:__cplusplus /std:c++17
System.ArgumentException: AddAction invocation conflicts with earlier invocation for "Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\iq99_le_CodeGen.obj": commandLineArguments differ
Previous AddAction was here:
<stack trace disabled - set BEE_DEBUG to '1' to trace the source of a conflict>

   at Bee.Core.Backend.<>c__DisplayClass36_0.<AddAction>b__2(String msg)
   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)
   at Bee.NativeProgramSupport.CLikeCompiler.SetupInvocation(NPath objectFile, CLikeCompilationUnitInstruction cLikeCompilationUnitInstruction)
   at Bee.NativeProgramSupport.CLikeCompilationUnitInstruction.AddActionFor(NPath objectFile)
   at Bee.NativeProgramSupport.NativeProgram.SetupObjectFilesAndSetupBuiltNativeProgram(String outputFilenameWithoutExtension, NativeProgramConfiguration config, NativeProgramFormat format, ArtifactLocationPolicy artifactLocationPolicy, ObjectFileProductionInstructions[] allUnits, NPath[] additionalObjectFiles, ILibrary[] libraries, NPath[] knownHeaders)
   at Bee.NativeProgramSupport.NativeProgram.SetupSpecificConfigurationImpl(NativeProgramConfiguration config, NativeProgramFormat format, ObjectFileProducer[] objectFileProducers)
   at Bee.NativeProgramSupport.NativeProgram.SetupSpecificConfiguration(NativeProgramConfiguration config, NativeProgramFormat format, ObjectFileProducer[] objectFileProducers)
   at PlayerBuildProgramLibrary.PlayerBuildProgramBase.SetupIl2CppBuild()
   at PlayerBuildProgramLibrary.PlayerBuildProgramBase.SetupPlayerBuild()
   at WinPlayerBuildProgram.WinPlayerBuildProgram.SetupPlayerBuild()
   at PlayerBuildProgramLibrary.PlayerBuildProgramBase.RunBuildProgram()
   at PlayerBuildProgramTypeWrapper.Run(String[] args)
   at Program.Main(String[] args)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Did you try the latest 2021 lts already? There have been many IL2CPP bug fixes made

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.

Ty. After upgrading + moving project to another dir I can successfully build now.

1 Like

What is causing the hash collision? purely bad luck?

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.

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.