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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Il2Cpp development build fails since Unity 2020.2

Discussion in 'Windows' started by Neadrim, Mar 31, 2021.

  1. Neadrim

    Neadrim

    Joined:
    Sep 26, 2017
    Posts:
    6
    After upgrading from Unity 2020.1.3f1 to Unity 2020.2.2f1, Standalone Windows and Switch builds are failing with the following exception only when Development Build is enabled:
    Code (CSharp):
    1. Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.2.2f1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --useprebuiltbuildprogram --no-colors
    2.  
    3. stdout:
    4. [             ] Require frontend run.  tundra.dag no longer valid. FileSignature timestamp changed: il2cpp_settings.json
    5. [        0s] Executed build program. Created build graph with 2 nodes.
    6. [           0s] Freezing tundra.dag.json into .dag (.dag file didn't exist)
    7. [BUSY       6s] Il2Cpp .../Library/Il2cppBuildCache/Windows/x64/Native/GameAssembly.dll
    8. ...
    9. [BUSY     526s] Il2Cpp .../Library/Il2cppBuildCache/Windows/x64/Native/GameAssembly.dll
    10. stderr:
    11. tundra: error: Out of memory in linear allocator: dynamicOutputDirectories
    12.  
    13. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <433cbae83977409887e43d50043210d2>:0)
    14. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <433cbae83977409887e43d50043210d2>:0)
    15. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String generatedCppOutputDirectory) (at <433cbae83977409887e43d50043210d2>:0)
    16. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.Boolean platformSupportsManagedDebugging) (at <433cbae83977409887e43d50043210d2>:0)
    17. UnityEditorInternal.IL2CPPBuilder.Run () (at <433cbae83977409887e43d50043210d2>:0)
    18. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <433cbae83977409887e43d50043210d2>:0)
    19. DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <433cbae83977409887e43d50043210d2>:0)
    20. DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <433cbae83977409887e43d50043210d2>:0)
    21. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <433cbae83977409887e43d50043210d2>:0)
    22. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    23. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <433cbae83977409887e43d50043210d2>:0)
    24. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <433cbae83977409887e43d50043210d2>:0)
    25. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <433cbae83977409887e43d50043210d2>:0)
    26. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    27.  
    I also tested 2021.1.0f1 since there's been a few il2cpp fixes but it yielded the same result.

    So after a lot of debugging, I noticed that the build fails as soon as the native GameAssembly.dll goes above 1GB. Our project is getting large and generates a lot of code from generics, so that might be a problem. In release, our GameAssembly.dll weights around 146 MB so it works fine but still, I'd like to know if that's an intended limitation and if there's any possible fix or workaround?

    In the meantime, I'm trying to figure out a way to reduce our code size but it's not trivial.

    Thanks.
     
    Last edited: Apr 1, 2021
  2. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    383
    Hey,

    This seems to be a known issue that was caught and fixed a few months ago, but maybe the fix hasn't made it to an official release yet (checking around on this), or it could be something else.

    Regardless, could you please file a bug for this issue so it can be tracked?
     
  3. Neadrim

    Neadrim

    Joined:
    Sep 26, 2017
    Posts:
    6
    I won't be able to submit a repro project though, but I'll file a bug.
    Thanks.
     
  4. monry_kidsstar

    monry_kidsstar

    Joined:
    Jun 7, 2013
    Posts:
    9
    I'm having the same problem.
    I haven't verified it exactly, but it seems to occur when the size of the compiled script exceeds 1GB.

    The fix was not included in 2021.1.4f1.
    When is the fix scheduled to be released?
     
  5. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    383
    The bug is being tracked by this internal case number: 1327846 but there doesn't appear to be a valid public link.

    From the current status: the bug has been fixed within IL2CPP branch but doesn't appear to have made it's way to a release branch yet. However, the bug has been "escalated" by a studio, and so it should make it's way to a 2020 LTS release soon.

    Feel free to file another bug, you might be able to get better updates on it.
     
    CyrylSz and monry_kidsstar like this.
  6. monry

    monry

    Joined:
    May 23, 2019
    Posts:
    9
    upload_2021-6-4_18-36-43.png

    This issue seems to have been fixed by Unity 2021.1.10f1

    In fact, we successfully built a large Unity project that had failed to build in the previous version.
     
    Last edited: Jun 6, 2021
    CyrylSz and Neadrim like this.
  7. CyrylSz

    CyrylSz

    Joined:
    Apr 17, 2014
    Posts:
    2
    I have an issue that seems kind of related to this topic. In Unity 2020.3 and 2021.1.10-14 when trying to build a project with IL2CPP I get an error:

    Code (CSharp):
    1. Exception: Failed running C:\Program Files\Unity\Hub\Editor\2021.1.14f1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --no-colors --prebuiltbuildprogram="C:\Program Files\Unity\Hub\Editor\2021.1.14f1\Editor\Data\il2cpp/build/BeeSettings/offline/artifacts/buildprogram/buildprogram.exe"
    2.  
    3. stdout:
    4. [             ] Require frontend run.  artifacts\tundra.dag.json does not exist yet
    5. error: Value cannot be zero.
    6. Parameter name: executableStringFor (System.ArgumentNullException)
    7.   at Bee.Core.Backend.AddAction
    8.   at Build+Il2Cpp.AddAction
    9.   at Build.Main
    10.   at System.RuntimeMethodHandle.InvokeMethod
    11.   at Bee.StandaloneBeeDriver.CreateBuildGraph
    12.   at Bee.StandaloneBeeDriver.InvokeTundra
    13.   at Bee.StandaloneBeeDriver.BuildMain
    14.   at Bee.StandaloneBeeDriver.Main
    15. stderr:
    16.  
    17. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <f9051bbfec05422cad88da502b7617ba>:0)
    18. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <f9051bbfec05422cad88da502b7617ba>:0)
    19. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <f9051bbfec05422cad88da502b7617ba>:0)
    20. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <f9051bbfec05422cad88da502b7617ba>:0)
    21. UnityEditorInternal.IL2CPPBuilder.Run () (at <f9051bbfec05422cad88da502b7617ba>:0)
    22. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <f9051bbfec05422cad88da502b7617ba>:0)
    23. DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <f9051bbfec05422cad88da502b7617ba>:0)
    24. DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <f9051bbfec05422cad88da502b7617ba>:0)
    25. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <f9051bbfec05422cad88da502b7617ba>:0)
    26. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    27. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <f9051bbfec05422cad88da502b7617ba>:0)
    28. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <f9051bbfec05422cad88da502b7617ba>:0)
    29. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <f9051bbfec05422cad88da502b7617ba>:0)
    30. UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  8. brian-taylor

    brian-taylor

    Unity Technologies

    Joined:
    Aug 2, 2019
    Posts:
    9
    Can you post your
    <unityproject-directory>\Library\Il2cppBuildCache\<platform>\<architecture>\il2cpp_settings.json
    file? We should be able to diagnose what's going on with that.
     
  9. CyrylSz

    CyrylSz

    Joined:
    Apr 17, 2014
    Posts:
    2
    Well, il2cpp_settings.json is simply empty. Here are the contents:
    |
    Code (CSharp):
    1. {}
     
  10. brian-taylor

    brian-taylor

    Unity Technologies

    Joined:
    Aug 2, 2019
    Posts:
    9
    Ah, that would definitely cause the issue you're seeing. Have you submitted a bug report for this project? If we can reproduce it on our end that will make it easier to debug. If you could also share your Editor.log there might also be some info in there to help diagnose.