Unity Issue Tracker - “UnityException: CreateScriptableObjectInstanceFromType can only be called from the main thread" errors are thrown when the VisualTreeAsset layout has text and it is assigned to uiDocument.visualTreeAsset property
Fixed
UUM-61722
“UnityException: CreateScriptableObjectInstanceFromType can only be called from the main thread" errors are thrown when the VisualTreeAsset layout has text and it is assigned to uiDocument.visualTreeAsset property
Fixed exception "CreateScriptableObjectInstanceFromType can only be called from the main"
Reproduction steps:
1. Open the attached “Project” project
2. Open the “Assets/Scenes/BootstrapScene.unity” Scene
3. Enter the Play Mode
4. Observe the Console Window
Expected result: No error is thrown
Actual result: Two “UnityException: CreateScriptableObjectInstanceFromType can only be called from the main thread" errors are thrown
Reproducible with: 2023.2.8f1
Could not test with: 2021.3.34f1 (“error CS0246” and two “error CS0115” compilation errors), 2022.3.19f1 (“error CS0246: The type or namespace name 'UxmlAttributeConverter<>' could not be found” compilation error), 2023.3.0b4 (“error CS0101: The namespace '<global namespace>' already contains a definition for 'IronSource'“ compilation error)
Reproducible on: macOS Sonoma 14.1.2 (Intel), Windows 10 (user’s)
Not reproducible on: No other environment tested
Note: The errors are thrown when exciting the Play Mode as well
Prioritise and Follow this issue
Have a workaround or additional info about this issue?