0
Fixed

Deserialization error: Newly added custom types not found after relaunch

GhostAegis 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year ago 3

Since updating to 1.4.0f10 I'm noticing that every time I relaunch Unity I have to re-add all my custom types. This seems to have been introduced somewhere between 1.3 and 1.4.

Note that I haven't added any new custom types since updating from 1.3. However, I seem to only just now be seeing this problem because updating to 1.4.0f10 required me to re-run setup due to GUID changes, meaning all my custom types got reset and I had to re-add everything.

Now, every time I open my project, I get a set of warnings in the pattern of:

[Deserialization] Unable to find type: 'Chronos.LocalClock'.

UnityEngine.Debug:LogWarning(Object, Object)
Ludiq.Serialization:HandleResult(String, fsResult, Object) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Serialization/Serialization.cs:190)
Ludiq.Serialization:DeserializeJson(fsSerializer, String, Object&, Boolean) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Serialization/Serialization.cs:178)
Ludiq.Serialization:DeserializeInto(SerializationData, Object&, Boolean) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Serialization/Serialization.cs:113)
Ludiq.LudiqScriptableObject:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Runtime/Unity/LudiqScriptableObject.cs:48)
UnityEditor.AssetDatabase:LoadAssetAtPath(String)
Ludiq.AssetUtility:TryLoad(String, DictionaryAsset&) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Utilities/AssetUtility.cs:97)
Ludiq.PluginConfiguration:LoadProjectSettings() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:112)
Ludiq.PluginConfiguration:Load() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:36)
Ludiq.PluginConfiguration:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:20)
Ludiq.PluginContainer:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:187)
Ludiq.PluginContainer:.cctor() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:17)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

I get one of these for each of my custom types I added. When I go into the Unit Options Wizard and go to the types page, all of my custom types I added have disappeared. I have to add them back in every time I relaunch.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi GhostAegis,

That's odd, it seems like the type itself is not found, not that the options fail to save.

  1. Are you able to use units from Chronos.LocalClock, for example?
  2. Which version of Unity are you using?
  3. What are the exact reproduction steps on a new project?

Unity 2018.1.9f2.

Units can be used no problem in spite of the error, so long as they were already in a graph.

I can't reproduce the problem with a fresh project that has Bolt 1.4.0f10 installed directly. However, I've managed to reproduce it reliably when upgrading a project from Bolt 1.3 to 1.4.x(happened with 1.4.0f8-10). 

Any types added in 1.3 are 'safe', but anything added after the upgrade gets lost each time Unity is opened.

So create a project, add Bolt 1.3, add some custom types, update to 1.4.x, add some more custom types, then close Unity. On opening Unity, the custom types added after 1.4.x trigger the error and are missing from the Type Options page.

Edit: Okay, weird follow-up. I thought I'd try updating to 2018.2.14f1, since 2018.1 crashed constantly in sleep mode for me (making this problem even worse, since I couldn't put my computer to sleep without re-adding all my custom types).

After updating the types vanished once, but after closing and re-opening Unity they seem to be sticking now. Instead, I'm seeing these two warnings on every launch. They don't seem to be causing any problems, though, at least none that I can detect.

Loading Bolt.VariablesAsset failed:
Assets\Ludiq\Bolt.Core\Generated\Variables\Resources\ApplicationVariables.asset
UnityEngine.Debug:LogWarning(Object)
Ludiq.AssetUtility:TryLoad(String, VariablesAsset&) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Utilities/AssetUtility.cs:105)
Bolt.EditorVariablesUtility:PrepareAsset(String) (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Core/Editor/Variables/EditorVariablesUtility.cs:38)
Bolt.EditorVariablesUtility:.cctor() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Core/Editor/Variables/EditorVariablesUtility.cs:16)
System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor(RuntimeTypeHandle)
Ludiq.PluginContainer:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:238)
Ludiq.PluginContainer:.cctor() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:17)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

Loading Ludiq.DictionaryAsset failed:
Assets\Ludiq\Ludiq.Core\Generated\ProjectSettings.asset
UnityEngine.Debug:LogWarning(Object)
Ludiq.AssetUtility:TryLoad(String, DictionaryAsset&) (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Utilities/AssetUtility.cs:105)
Ludiq.PluginConfiguration:LoadProjectSettings() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:112)
Ludiq.PluginConfiguration:Load() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:36)
Ludiq.PluginConfiguration:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginConfiguration.cs:20)
Ludiq.PluginContainer:Initialize() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:187)
Ludiq.PluginContainer:.cctor() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugins/PluginContainer.cs:17)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()


Fixed

Hi GhostAegis. It's a bit hard for me to track what might have happened along the way during your upgrade unfortunately. But the warnings you're getting are our #1 known issue: https://ludiq.io/bolt/known-issues#loadasset

If the issue is gone from the latest stable Bolt version, I'll mark this as closed for now!