Search Issue Tracker

Duplicate

Votes

0

Found in

6000.2.0a3

Issue ID

UUM-97150

Regression

Yes

"InvalidOperationException: Cannot modify VisualElement hierarchy during layout calculation" error is logged and Player Settings window becomes blank after changing Scripting backend and Api Compatibility Level fields

-

*Steps to reproduce:*
1. Create a new project
2. Change Scripting backend to IL2CPP (Edit > Project Settings... > Player)
3. Change Api Compatibility Level to the that's not selected
4. Wait for script compiling to finish loading and observe the Console and Player Settings windows

*Actual results:* 
{code:java}
InvalidOperationException: Cannot modify VisualElement hierarchy during layout calculation
UnityEngine.UIElements.VisualElement+Hierarchy.Clear () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/VisualElementHierarchy.cs:673)
UnityEngine.UIElements.VisualElement.Clear () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/VisualElementHierarchy.cs:256)
UnityEditor.SettingsWindow.ProviderChanged (UnityEditor.SettingsProvider lastSelectedProvider, UnityEditor.SettingsProvider newlySelectedProvider) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:276)
UnityEditor.SettingsTreeView.SelectionChanged (System.Collections.Generic.IList`1[T] selectedIds) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsTreeView.cs:66)
UnityEditor.SettingsTreeView.FocusSelection (System.Int32 selectedId) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsTreeView.cs:46)
UnityEditor.SettingsWindow.SelectProviderByName (System.String name, System.Boolean ignoreLastSelected) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:111)
UnityEditor.SettingsWindow.RestoreSelection () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:242)
UnityEditor.SettingsWindow.InitProviders () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:168)
UnityEditor.SettingsWindow.DrawTreeView () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:500)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/IMGUIContainer.cs:403)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:219)
{code}
 

error is thrown and Player Settings window becomes blank
*Expected results:* No errors are thrown and Scripting backend and Api Compatability Level fields change to the selected ones in the Player Settings window

*Reproducible with versions:* 6000.2.0a1, 6000.2.0a3
*Not reproducible with versions:* 2021.3.48f1, 2022.3.58f1, 6000.0.38f1, 6000.1.0a10, 6000.1.0b5

*Tested on (OS):* macOS Sequoia 15.2 (Intel)

*Notes:*
* If issue is not reproducing repeat step 3 a few times, sometimes it also reproduces after Scripting backend to Mono and back

* Additionally "Leak Detected : Persistent allocates 2 individual allocations. To find out more please enable 'Settings > Jobs > Leak Detection Level > Enabled With Stack Trace' and reproduce the leak again." message is logged

  1. This is a duplicate of issue #UUM-97149

    Changing editor theme causes InvalidOperationException
  1. Resolution Note:

    null
    Duplicate of another internal issue: UUM-97149: Changing editor theme causes InvalidOperationException

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.