0
Fixed

2.0.0a9 - Assemblies UnityException: LoadAssetAtPath can only be called from the main thread

David Svezhintsev 7 months ago updated by Lazlo Bonin (Lead Developer) 7 months ago 2

During Bolt Setup in empty project if you switch to Assemblies during the Extractor step, assemblies won't load, and if you try to search for one, it will result in an error:

UnityException: LoadAssetAtPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEditor.AssetDatabase.LoadAssetAtPath[T] (System.String assetPath) (at <9ba1187881a84a08b5f9c4cb333d7a6a>:0)
Ludiq.EditorAssetResourceProvider.LoadAsset[T] (System.String path) (at Assets/Ludiq/Ludiq.Core/Editor/ResourceProviders/EditorAssetResourceProvider.cs:89)
Ludiq.EditorAssetResourceProvider.LoadTexture (System.String path, Ludiq.CreateTextureOptions options) (at Assets/Ludiq/Ludiq.Core/Editor/ResourceProviders/EditorAssetResourceProvider.cs:94)
Ludiq.EditorTexture.Load (Ludiq.IResourceProvider resources, System.String path, Ludiq.TextureResolution[] resolutions, Ludiq.CreateTextureOptions options, System.Boolean required) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Textures/EditorTexture.cs:294)
Ludiq.EditorTexture.Load (System.Collections.Generic.IEnumerable`1[T] resourceProviders, System.String path, Ludiq.TextureResolution[] resolutions, Ludiq.CreateTextureOptions options, System.Boolean required) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Textures/EditorTexture.cs:195)
Ludiq.PluginResources.LoadIcon (System.String path, Ludiq.TextureResolution[] resolutions, System.Boolean required) (at Assets/Ludiq/Ludiq.Core/Editor/Plugins/PluginResources.cs:174)
Ludiq.PluginResources.LoadIcon (System.String path, System.Boolean required) (at Assets/Ludiq/Ludiq.Core/Editor/Plugins/PluginResources.cs:169)
Ludiq.PluginResources.LoadSharedIcon (System.String path, System.Boolean required) (at Assets/Ludiq/Ludiq.Core/Editor/Plugins/PluginResources.cs:183)
Ludiq.Icons.GetResourcesTypeIcon (System.String fileName) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Icons/Icons.cs:329)
Ludiq.Icons.GetCustomTypeIcon (System.Type type, System.Boolean inherit) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Icons/Icons.cs:138)
Ludiq.Icons.Type (System.Type type) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Icons/Icons.cs:112)
Ludiq.Icons.Icon (System.Type type) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Icons/Icons.cs:90)
Ludiq.LooseAssemblyNameOption..ctor (Ludiq.LooseAssemblyName looseAssemblyName) (at Assets/Ludiq/Ludiq.Core/Editor/Reflection/LooseAssemblyNameOption.cs:14)
Ludiq.LooseAssemblyNameOptionTree+<>c.b__5_1 (Ludiq.LooseAssemblyName x) (at Assets/Ludiq/Ludiq.Core/Editor/Reflection/LooseAssemblyNameOptionTree.cs:21)
System.Linq.Enumerable+SelectIPartitionIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Ludiq.FuzzyWindow.Populate (Ludiq.FuzzyOptionNode node, System.Collections.Generic.IEnumerable`1[T] children, System.Nullable`1[T] cancellation) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:25)
Ludiq.FuzzyWindow+<>c__DisplayClass19_0.b__0 () (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:418)
Ludiq.FuzzyWindow.RunTaskSynchronous (System.Action task) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:1401)
UnityEngine.Debug:LogException(Exception)
Ludiq.FuzzyWindow:RunTaskSynchronous(Action) (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:1406)
Ludiq.FuzzyWindow:Work() (at Assets/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:1435)
System.Threading.ThreadHelper:ThreadStart()
Bolt Version:
2.0.0a9
Unity Version:
2019.3.2f1
Platform(s):
Windows
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2