While testing our app after switching scenes Unicode-Text-Icons on some buttons dissapear and in the player log there is the following entry:
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Material.HasProperty(UnityEngine.Material,int)
at UnityEngine.TextCore.Text.TextGenerator.GenerateTextMesh (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings, UnityEngine.TextCore.Text.TextInfo textInfo) [0x00d59] in C:\buildslave\unity\build\Modules\TextCoreTextEngine\Managed\TextGenerator.cs:937
at UnityEngine.TextCore.Text.TextGenerator.GenerateText (UnityEngine.TextCore.Text.TextGenerationSettings settings, UnityEngine.TextCore.Text.TextInfo textInfo) [0x00068] in C:\buildslave\unity\build\Modules\TextCoreTextEngine\Managed\TextGenerator.cs:319
at UnityEngine.TextCore.Text.TextHandle.Update (UnityEngine.TextCore.Text.TextGenerationSettings tgs) [0x0000d] in C:\buildslave\unity\build\Modules\TextCoreTextEngine\Managed\TextHandle.cs:426
at UnityEngine.UIElements.UITKTextHandle.Update () [0x000b5] in C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Text\UITKTextHandle.cs:111
at UnityEngine.UIElements.UIR.Implementation.UIRStylePainter.DrawText (UnityEngine.UIElements.TextElement te) [0x00013] in C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRStylePainter.cs:284
at UnityEngine.UIElements.MeshGenerationContextUtils.Text (UnityEngine.UIElements.MeshGenerationContext mgc, UnityEngine.UIElements.TextElement te) [0x0000b] in C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRMeshGenerationContext.cs:647
at UnityEngine.UIElements.TextElement.OnGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) [0x00008] in C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\TextElement.cs:180
at UnityEngine.UIElements.VisualElement.InvokeGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) [0x0001c] in C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\VisualElement.cs:1558
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.UIElements.VisualElement:InvokeGenerateVisualContent(MeshGenerationContext) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\VisualElement.cs:1562)
UnityEngine.UIElements.UIR.Implementation.CommandGenerator:InvokeGenerateVisualContent(VisualElement, MeshGenerationContext) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRCommandGenerator.cs:359)
UnityEngine.UIElements.UIR.Implementation.CommandGenerator:paintElement(RenderChain, VisualElement, ChainBuilderStats&) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRCommandGenerator.cs:97)
UnityEngine.UIElements.UIR.Implementation.RenderEvents:smile:epthFirstOnVisualsChanged(RenderChain, VisualElement, UInt32, Boolean, Boolean, ChainBuilderStats&) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRRenderEvents.cs:655)
UnityEngine.UIElements.UIR.Implementation.RenderEvents:processOnVisualsChanged(RenderChain, VisualElement, UInt32, ChainBuilderStats&) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRRenderEvents.cs:55)
UnityEngine.UIElements.UIR.RenderChain:processChanges() (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRRenderChain.cs:433)
UnityEngine.UIElements.UIRRepaintUpdater:Update() (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Renderer\UIRRepaintUpdater.cs:62)
UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase(VisualTreeUpdatePhase) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\VisualTreeUpdater.cs:111)
UnityEngine.UIElements.Panel:UpdateForRepaint() (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Panel.cs:988)
UnityEngine.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Panel.cs:1034)
UnityEngine.UIElements.BaseRuntimePanel:Repaint(Event) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\Panel.cs:1188)
UnityEngine.UIElements.UIElementsRuntimeUtility:RepaintOverlayPanel(BaseRuntimePanel) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\UIElementsRuntimeUtility.cs:151)
UnityEngine.UIElements.UIElementsRuntimeUtility:RenderOverlaysBeforePriority(Int32, Single) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\UIElementsRuntimeUtility.cs:182)
UnityEngine.UIElements.<>c:<.cctor>b__9_1(Int32, Int32) (at C:\buildslave\unity\build\ModuleOverrides\com.unity.ui\Core\UIElementsRuntimeUtility.cs:42)
UnityEngine.Canvas:RenderExtraOverlaysBefore(Int32, Int32) (at C:\buildslave\unity\build\Modules\UI\ScriptBindings\UICanvas.bindings.cs:114)
Has anyone experienced the same?
It only happens in builds, not in the editor.
Unity version is 2022.1.6