+3
Cannot Reproduce

Wizard windows close silently during recompile

Vitaliy Gladiyenko 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 20

If you add an Assembly from the list and after it is added immediately press the + button again, the Wizard window disappears and you have to restart it from the Unity menu.

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

Answer

Answer
Cannot Reproduce

Alas, I've given it many tries, but I can't reproduce this on a clean Bolt install (whether in 2017.1/2, Windows, Mac, .NET 3.5/4.6, etc.).

Here's what is most likely happening:

  1. A recompile operation gets started, either before you open a wizard window or when new script files get generated from that wizard (e.g. generating inspectors)
  2. When Unity finishes recompiling, it automatically reloads all assemblies. This makes Bolt lose track of its wizard windows, because they're not serialized across assembly reloads for various internal reasons.
  3. Seeing that the window references are lost, Bolt closes the window instead of throwing an error.

The issue is that #2 should not be happening because Bolt windows use the EditorApplication.LockReloadAssemblies method to prevent an assembly reload while they're open, but for some reason that doesn't seem to work for you.

My hypothesis is that some third party plugins you have installed also use EditorApplication.UnlockReloadAssemblies. One way to test that would be to try to reproduce the issue on a clean project with just Bolt. If it doesn't happen then, this is likely the cause. I know some of you mentioned using Odin; what other plugins do you use?

In the mean time, the current suggested workaround is:

  1. Wait for any recompile operation to finish before opening a Bolt tool window
  2. In the Setup Wizard, skip the inspectors generation step
Pending Review

Hi Vitaliy, welcome to the community!

I can't reproduce this issue here. Are you using Windows or Mac?

+1

Hi Lazlo. I'm using Windows. Also probably worth noting, that if I wait for a couple of seconds after picking an Assembly from the list, pressing the + button doesn't crash the UI. This happens only if I press it immediately after. Maybe not so critical, but considering the changes Unity made in naming it took a bit longer for me to pick all the stuff I needed :)

I can confirm that this also happened to me a few times. Few times in assembly picker, other times somewhere else in the setup wizard. Reproduction steps unknown. Just spend some time clicking stuff in the wizard and it should happen I guess.

Windows here.

Good luck fixin'! 

Are there any errors in the console when that happens?

You say "crash", but does it just actually close silently?

+1

Yeah, it probably just closes, but since I wouldn't expect it to close and the settings are not being saved, let's say it force closes :) Didn't see any errors in the console though.

For me, the modules I have added were saved after force close.

I was able to reproduce this problem. Here is the error log.


NullReferenceException: Object reference not set to an instance of an object
Ludiq.FuzzyWindow.get_activeParent () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:287)
Ludiq.FuzzyWindow.Update () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:204)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:354)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)


NullReferenceException: Object reference not set to an instance of an object
Ludiq.FuzzyWindow.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:537)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:107)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:127)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I'm experiencing this issue as well. From my experience it closes the first time and usually works the second time I try it.

Still can't reproduce this here. Thanks for the error log, Eric, but it seems somehow "impossible" that the references mentioned would be null. 

To everyone getting this error:

  • Windows or Mac?
  • Which Bolt version?
  • Which Unity version?
  • Which .NET version? (3.5 or 4.6)

Also having the issue. Same error log than above. 
I'm using all the latest software versions in Windows. 
(Unity 2017.2.0f3) (.NET 4.7.1) (Bolt 1.2.2 )

The "crash" seems to occur for me when i'm searching a type for adding a new one in the setup wizard. When I'm making a reasearch he sometimes freezes (the little wheel, in the bottom right of Unity also freezes) and after few seconds he just quits the setup wizard window, with the error log Eric posted above. 

I also noticed that the "set to default" in the inspectors setup part will sometimes remove all the Bolt and Luqid assembly. Have to close the window and restart setup to see them again by default. 

Thanks for submitting your specs Corjn.

I need more from others: Vitaliy, Crystallius, Eric, Nanda, what OS / .NET version / Bolt version are you using?

  • Windows 64-bit
  • Bolt 1.2.1
  • Unity 2017.2.0f3
  • .NET 3.5
  • Windows 10 x64
  • The issue was with Bolt 1.1.2 and I didn't have a chance to check it on the latest one
  • Unity 2017.2.0f3
  • .NET 4.6
  • I use Windows 10 64-bit.
  • I was experiencing the issue when I was using Bolt 1.2.1. I haven't used Bolt much since I upgraded to 1.2.2 so I'm not sure if the problem is still occurring in version 1.2.2. However, I am experiencing an issue that may or may not be related to this; I will open a separate topic about this in a moment (just saying this here in case it is related to this issue).
  • I use Unity version 2017.2.0f3.
  • .NET 4.6

Hello!

I just created a new Unity project, imported Bolt and was using the Bolt Setup Wizard, but it redirects me to the first 'page' of the wizard when I click 'Generate Inspectors' and try to add a new assembly (though it sometimes happens when I'm just scrolling down the assembly list). I created a gif to show you what is happening:


This is an empty project (aside from the Odin Inspector plugin which I installed a few minutes before this) and a fresh install of Bolt 1.2.2 (so it's still happening in version 1.2.2).

I see you're already working on a fix, but thought I'd post it here anyway. Hope it helps!

Ahh, thanks for the gif Nanda, that actually helps a lot!

Because there is no error in the console and it restarts, it seems that maybe the assemblies recompile (the window should lock recompile while open, but maybe that's not working). Do you see the little spinner wheel in the bottom right of the editor before the crash? (Question to everyone getting the bug)

Hey, just to say that it's exactly the same for me on the gif. And yes, I have the little spinner wheel too. 

Hope it can help. 

Answer
Cannot Reproduce

Alas, I've given it many tries, but I can't reproduce this on a clean Bolt install (whether in 2017.1/2, Windows, Mac, .NET 3.5/4.6, etc.).

Here's what is most likely happening:

  1. A recompile operation gets started, either before you open a wizard window or when new script files get generated from that wizard (e.g. generating inspectors)
  2. When Unity finishes recompiling, it automatically reloads all assemblies. This makes Bolt lose track of its wizard windows, because they're not serialized across assembly reloads for various internal reasons.
  3. Seeing that the window references are lost, Bolt closes the window instead of throwing an error.

The issue is that #2 should not be happening because Bolt windows use the EditorApplication.LockReloadAssemblies method to prevent an assembly reload while they're open, but for some reason that doesn't seem to work for you.

My hypothesis is that some third party plugins you have installed also use EditorApplication.UnlockReloadAssemblies. One way to test that would be to try to reproduce the issue on a clean project with just Bolt. If it doesn't happen then, this is likely the cause. I know some of you mentioned using Odin; what other plugins do you use?

In the mean time, the current suggested workaround is:

  1. Wait for any recompile operation to finish before opening a Bolt tool window
  2. In the Setup Wizard, skip the inspectors generation step