microsoft / MixedReality-WorldLockingTools-Unity

Unity tools to provide a stable coordinate system anchored to the physical world.
https://microsoft.github.io/MixedReality-WorldLockingTools-Unity/README.html
MIT License
188 stars 45 forks source link

Creating PluginNoop Error when build platform different than editor #266

Closed genereddick closed 2 years ago

genereddick commented 2 years ago

When testing in the Unity editor, if the platform in the Build Settings is different than the Unity editor (specifically if the build target is iOS and the editor is running on Mac or PC) the WLT throws an error:

Creating PluginNoop, is this intentional?

It is unclear if this error has any impact, if there is a more serious issue that makes this deserve an error, or if there is a different configuration that would address this, but ideally the WLT should be able to handle this an editor / platform mismatch. For example, AR Foundation shows numerous warnings about missing subsystems when running in the Unity editor on a Mac but no actual errors are thrown.

Unity Edition: Unity 2021.2.12f1 WLT: 1.5.7 with minimum implementation (World Locking Manager + Adjustment, no visualizers)

Anchor Management Settings are set to Anchor Subsystem: AR Foundation, but same error occurs with settings of null and XRSDK

Details: Error happens in the Editor running on PC and Mac with platform set to "iOS" (does not happen if build target is "Windows, Mac, Linus" and does not happen on PC if platform is "Universal Windows Platform". It is not happening in a different test project running on Unity 2020.3.29f1. Later I'll see what happens if I upgrade that project to Unity 2021.

Error: Creating PluginNoop, is this intentional? UnityEngine.Debug:LogError (object) Microsoft.MixedReality.WorldLocking.Core.PluginNoop:.ctor () (at Assets/WorldLocking.Engine/PluginNoop.cs:41) Microsoft.MixedReality.WorldLocking.Core.WorldLockingManager:.ctor () (at Assets/WorldLocking.Core/Scripts/WorldLockingManager.cs:740) Microsoft.MixedReality.WorldLocking.Core.WorldLockingManager:GetInstance () (at Assets/WorldLocking.Core/Scripts/WorldLockingManager.cs:805) Microsoft.MixedReality.WorldLocking.Core.WorldLockingContext:CheckPushSettings (UnityEngine.SceneManagement.Scene) (at Assets/WorldLocking.Core/Scripts/WorldLockingContext.cs:89) Microsoft.MixedReality.WorldLocking.Core.WorldLockingContext:OnEnable () (at Assets/WorldLocking.Core/Scripts/WorldLockingContext.cs:56)

image
fast-slow-still commented 2 years ago

Hi @genereddick, I had a look. WLT does NOT throw an error. It logs a warning. The warning is a gentle reminder that running in the editor (or other unsupported platform), no anchor subsystem is available and so no actual world-locking will take place. It then goes on to handle the platform / editor mismatch.

I am curious how this differs in your mind to AR Foundation showing "numerous warnings about missing subsystems when running in the Unity editor on a Mac but no actual errors are thrown." It seems like exactly the same thing to me.

fast-slow-still commented 2 years ago

Also, when reporting bugs, please include enough version info etc for the bug to be reproduced. Thanks.

https://docs.microsoft.com/en-us/mixed-reality/world-locking-tools/documentation/howtos/contributing#reporting-a-bug

genereddick commented 2 years ago

@fast-slow-still I get an error message rather than a warning -- maybe the issue is that the warning is a LogError message and so appears as an error but isn't actually "throwing" an error? -- and it may be the result of the specific Unity platform or other configuration. I'll update the original post with bug details.

genereddick commented 2 years ago

And, I just upgraded to WLT 1.5.8 and the error is gone! :-)

'll test some more over the day, unless it shows up again you can probably close.