Stuck on "Reloading domain" when the preferences are set to recompile after finished playing

Hi,

We recently installed the Hot Reload plugin for Unity (Download | Hot Reload for Unity) which made us change our preferences settings to “Recompile After Finished Playing”. The problem is that when we exit the play mode, Unity tries to recompile and fails to do it because of FMOD. The window “Reloading domain” can’t disappear and we have to kill Unity process. Here is the editor.log part that explain the problem :

Reloading assemblies after forced synchronous recompile.
Begin MonoManager ReloadAssembly
Thread 0x381d87000 may have been prematurely finalized
UnityException: Load 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.
  at (wrapper managed-to-native) UnityEngine.ResourcesAPIInternal.Load(string,System.Type)
  at UnityEngine.ResourcesAPI.Load (System.String path, System.Type systemTypeInstance) [0x00000] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:71 
  at UnityEngine.Resources.Load (System.String path, System.Type systemTypeInstance) [0x00001] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:122 
  at UnityEngine.Resources.Load (System.String path) [0x00001] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:112 
  at FMODUnity.Settings.Initialize () [0x0001a] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/Settings.cs:267 
  at FMODUnity.Settings.get_Instance () [0x0000f] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/Settings.cs:255 
  at FMODUnity.RuntimeUtils.DebugLogError (System.String message) [0x00001] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/RuntimeUtils.cs:572 
  at FMODUnity.RuntimeManager.DEBUG_CALLBACK (FMOD.DEBUG_FLAGS flags, System.IntPtr filePtr, System.Int32 line, System.IntPtr funcPtr, System.IntPtr messagePtr) [0x00023] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/RuntimeManager.cs:77 
  at (wrapper native-to-managed) FMODUnity.RuntimeManager.DEBUG_CALLBACK(FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
UnityEngine.ResourcesAPIInternal:Load(String, Type)
UnityEngine.ResourcesAPI:Load(String, Type) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:71)
UnityEngine.Resources:Load(String, Type) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:122)
UnityEngine.Resources:Load(String) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:112)
FMODUnity.Settings:Initialize() (at Assets/Plugins/FMOD/src/Settings.cs:267)
FMODUnity.Settings:get_Instance() (at Assets/Plugins/FMOD/src/Settings.cs:255)
FMODUnity.RuntimeUtils:DebugLogError(String) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:572)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/RuntimeManager.cs:77)

(Filename: Assets/Plugins/FMOD/src/Settings.cs Line: 267)

Notes :

  • Macbook Pro M1 Max 16"
  • Unity 2022.2.5f1 (silicon build)
  • FMOD 2.02.11 (tested with 2.02.09 too)

Hi,

Changing a reference and trying to trigger a OneShot I was not able to reproduce the issue.

Were there any particular changes you were making when it was getting stuck? Or is it every time you try and end play mode?

Would it be possible to get a stripped-out version of the Unity project that is experiencing the issue uploaded to your Profile?

It happens everytime I exit play mode. If I comment the line that is causing this problem in the Settings.cs , Fmod doesn’t work but the game can exit play mode properly. Did you try it with an Apple Silicon build ? Maybe it’s only related to this specific version, I don’t know.

It would be really hard for us to send the project right now.

Do you have an update on this ? We can try to build an empty repro project if needed.

Hi,

Apologies for the delayed response. That would be extremely useful, you can either upload the project to your Profile or DM me directly.