Unity 2021.3.27 Crash during build

Hi

I am trying to build my VR project but the editor crashes. This is the editor log

[00:00:00] Builtin Sky manager started.
[00:00:00] Finished 1 Bake Ambient Probe job (0.00s execute, 0.00s integrate, 0.01s wallclock)
[00:00:00] Finished 1 Bake Ambient Probe job (0.00s execute, 0.00s integrate, 0.01s wallclock)
Refreshing native plugins compatible for Editor in 6.99 ms, found 6 plugins.
Preloading 1 native plugins for Editor in 0.08 ms.
Compiling shader “Universal Render Pipeline/Particles/Unlit” pass “ForwardLit” (vp)
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Transform.get_childCount(UnityEngine.Transform)
at UnityEngine.Transform+Enumerator.MoveNext () [0x00001] in :0
at UnityEditor.ShaderKeywordFilter.SettingsNode.GatherFilterData (System.String nodeName, System.Object containerObject, System.Collections.Generic.HashSet1[T] visited, UnityEditor.ShaderKeywordFilter.Constraints parentConstraints) [0x001b7] in <a53e7cd0bf8c4035ac3e78fb7b43c4a6>:0 at UnityEditor.ShaderKeywordFilter.SettingsNode.GatherFilterData (System.String nodeName, System.Object containerObject, System.Collections.Generic.HashSet1[T] visited, UnityEditor.ShaderKeywordFilter.Constraints parentConstraints) [0x00222] in :0
at UnityEditor.ShaderKeywordFilter.SettingsNode.GatherFilterData (System.String nodeName, System.Object containerObject, System.Collections.Generic.HashSet1[T] visited, UnityEditor.ShaderKeywordFilter.Constraints parentConstraints) [0x00165] in <a53e7cd0bf8c4035ac3e78fb7b43c4a6>:0 at UnityEditor.ShaderKeywordFilter.SettingsNode.GatherFilterData (System.String nodeName, System.Object containerObject, System.Collections.Generic.HashSet1[T] visited, UnityEditor.ShaderKeywordFilter.Constraints parentConstraints) [0x00165] in :0
at UnityEditor.ShaderKeywordFilter.ShaderKeywordFilterUtil.GetFilterDataCached (System.String nodeName, UnityEngine.Object containerObject) [0x0004e] in :0
at UnityEditor.ShaderKeywordFilter.ShaderKeywordFilterUtil.GetKeywordFilterVariants (System.String buildTargetGroupName, UnityEditor.ShaderKeywordFilter.ConstraintState constraintState) [0x00046] in :0
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[ ], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[ ], Boolean)
UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)
UnityEditor.BuildPlayerWindow:CallBuildMethods(Boolean, BuildOptions)
UnityEditor.BuildPlayerWindow:GUIBuildButtons(IBuildWindowExtension, Boolean, Boolean, Boolean, BuildPlatform, IBuildPostprocessor)
UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings()
UnityEditor.BuildPlayerWindow:OnGUI()
UnityEditor.HostView:InvokeOnGUI(Rect)
UnityEditor.DockArea:smile:rawView(Rect)
UnityEditor.DockArea:OldOnGUI()
UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Action, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI(EventBase, Boolean, Boolean)
UnityEngine.UIElements.IMGUIContainer:HandleEvent(EventBase)
UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase(EventBase)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy:smile:ispatchEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies(EventBase, IPanel, Boolean)
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:ProcessEventQueue()
UnityEngine.UIElements.EventDispatcher:OpenGate()
UnityEngine.UIElements.EventDispatcherGate:smile:ispose()
UnityEngine.UIElements.EventDispatcher:ProcessEvent(EventBase, IPanel)
UnityEngine.UIElements.EventDispatcher:smile:ispatch(EventBase, IPanel, DispatchMode)
UnityEngine.UIElements.BaseVisualElementPanel:SendEvent(EventBase, DispatchMode)
UnityEngine.UIElements.UIElementsUtility:smile:oDispatch(BaseVisualElementPanel)
UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent(Int32, IntPtr, Boolean&)
UnityEngine.UIElements.UIEventRegistration:ProcessEvent(Int32, IntPtr)
UnityEngine.UIElements.<>c:<.cctor>b__1_2(Int32, IntPtr)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

=================================================================
Native Crash Reporting

Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

=================================================================
Managed Stacktrace:

at <0xffffffff>
at UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck <0x000d6>
at DefaultBuildMethods:BuildPlayer <0x00492>
at UnityEditor.BuildPlayerWindow:CallBuildMethods <0x004d2>
at UnityEditor.BuildPlayerWindow:GUIBuildButtons <0x00ef2>
at UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings <0x02232>
at UnityEditor.BuildPlayerWindow:OnGUI <0x00472>
at UnityEditor.HostView:InvokeOnGUI <0x00159>
at UnityEditor.DockArea:smile:rawView <0x00042>
at UnityEditor.DockArea:OldOnGUI <0x00afa>
at UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI <0x00926>
at UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent <0x0040a>
at UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent <0x0014a>
at UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent <0x00032>
at UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw <0x000ba>
at UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI <0x005b2>
at UnityEngine.UIElements.IMGUIContainer:HandleEvent <0x0010a>
at UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase <0x00047>
at UnityEngine.UIElements.MouseCaptureDispatchingStrategy:smile:ispatchEvent <0x0064a>
at UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies <0x000ad>
at UnityEngine.UIElements.EventDispatcher:ProcessEvent <0x0017a>
at UnityEngine.UIElements.EventDispatcher:ProcessEventQueue <0x0014a>
at UnityEngine.UIElements.EventDispatcher:OpenGate <0x00072>
at UnityEngine.UIElements.EventDispatcherGate:smile:ispose <0x0002a>
at UnityEngine.UIElements.EventDispatcher:ProcessEvent <0x00402>
at UnityEngine.UIElements.EventDispatcher:smile:ispatch <0x00132>
at UnityEngine.UIElements.BaseVisualElementPanel:SendEvent <0x0007a>
at UnityEngine.UIElements.UIElementsUtility:smile:oDispatch <0x00502>
at UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent <0x000f2>
at UnityEngine.UIElements.UIEventRegistration:ProcessEvent <0x0008e>
at <>c:<.cctor>b__1_2 <0x0002a>
at UnityEngine.GUIUtility:ProcessEvent <0x0005c>
at :runtime_invoke_void_int_intptr_intptr& <0x00095>

Received signal SIGSEGV
Obtained 2 stack frames
RtlLookupFunctionEntry returned NULL function. Aborting stack walk.

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.

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

Android Gradle errors and other related stuff:

I followed your steps and tested a few things in an empty project, importing my main project assets one by one.

I found out that an asset called UniStorm caused URP during build to crash. I am investigating further and will be in contact with the developer of the asset.

Thank you for your help.

1 Like

Did you guys find a solution? Android builds with URP often crashed for me as well (but not always…in like 40% of the cases). Unity 2021.3.27 is very unique version as it can be used for PS, Xbox, Switch, and all other platforms…this soon will not be the case but as of now, still all consoles support it