Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Sudden build errors without apparent reason [2021.3.20f1)

Discussion in 'Editor & General Support' started by KarimEO, Mar 28, 2023.

  1. KarimEO

    KarimEO

    Joined:
    May 23, 2022
    Posts:
    2
    Hello,

    Several of my Unity projects have become unable to build without apparent reason. Projects I have not made any changes to which I were able to previously build now result in errors. I am building for ARM 64 for HoloLens 2 in Unity 2021.3.20f1 (Universal Windows Platform). I have made an empty project which does build fine for the same platform. But all my previous projects have become unbuildable with the same errors:

    The errors I am getting are:

    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <6e08e61cfda04255b3972ba7f0515fae>:0
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6e08e61cfda04255b3972ba7f0515fae>:0
    4. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    5.  
    6.  
    and


    Code (CSharp):
    1. Exception: Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 0 failed ones
    2. Error: Internal build system error. Backend exited with code 2.
    3. tundra: error: Failed to open file "C:/Users/ouaha/Documents/GitHub/HoloLensTestProject/Project 1/Library/Il2cppBuildCache/UWP/ARM64/buildstate/tundra.log.json" for structured logging
    4.    at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
    5. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    6. UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    7. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    8. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    9. UnityEditorInternal.IL2CPPBuilder.Run () (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    10. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    11. PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/build/output/unity/unity/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1904)
    12. PostProcessWinRT.RunIL2CPP () (at C:/build/output/unity/unity/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1873)
    13. PostProcessWinRT.Process () (at C:/build/output/unity/unity/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:212)
    14. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/build/output/unity/unity/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:86)
    15. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    16. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/build/output/unity/unity/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:90)
    17. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
    18. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <6e08e61cfda04255b3972ba7f0515fae>:0)
    19. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    All the projects still run fine in the editor but result in these errors when being built. I have been looking to resolve the issue all day but cannot figure out how to. Could anyone please assist? Many thanks!
     
    Last edited: Mar 28, 2023
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,006
    How to troubleshoot build failures:

    First, make a blank project with a single blank scene and prove that it builds successfully.

    If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

    Until you can build a blank project to the target platform, don't fiddle with anything else.

    Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

    Most often things that prevent building are third-party libraries such as Firebase.

    Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

    It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

    Android build not building:

    Recently (circa July 2022) there have been reports of Unity's installer failing to install the Android Tools.

    https://forum.unity.com/threads/cant-build-for-android.1306098/

    Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022:

    https://forum.unity.com/threads/aab...y-2021-3-8-with-jdk-1-8.1322211/#post-8551193

    Android Gradle errors and other related stuff:

    https://forum.unity.com/threads/unity-gradle-bug-please-help.1368018/#post-8625789
     
  3. KarimEO

    KarimEO

    Joined:
    May 23, 2022
    Posts:
    2
    Hi Kurt, thanks for your response. I have seen you post this on other threads and read it and followed the steps. I have set up a blank project as you suggested to test build, which was done succesfully. But like I said, all my projects which previously built fine have suddenly stopped building successfully. I have not done any updates to Unity nor have I made changes to the project..
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,006
    This does not change the bisection process.

    SOMETHING changed and now something doesn't build.

    It might be something in your project.

    It might be something else.

    If you know a better way than bisection to find it, please do post.
     
  5. elhongo

    elhongo

    Joined:
    Aug 13, 2015
    Posts:
    48
    we're experiencing the same error in Unity 2021.3.15 for HoloLens 2