Without changing anything in the scene, just adding the manual XRLoader code, doesn’t work → black screen.
Delaying ARSession and ARSessionOrigin activation after the XR plugin is loaded successfully → black screnn; there is an infinite loop because ARSession.state = None.
Loading the XR plugin in a scene and changing to the plane detection scene 1 second later (just in case) → black screen and log bellow
No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings. W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:GetActiveSubsystemInstance()* *W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:EnsureSubsystemInstanceSet() W/Unity : UnityEngine.XR.ARFoundation.ARSession:OnEnable() W/Unity : W/Unity : No ARSession available for the current platform. Please ensure you have installed the relevant XR Plugin package for this platform via the Package Manager. W/Unity : W/Unity : No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings. W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:GetActiveSubsystemInstance()* *W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:EnsureSubsystemInstanceSet() W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:OnEnable()* *W/Unity :* *W/Unity : No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.* *W/Unity : UnityEngine.XR.ARFoundation.ARInputManager:GetActiveSubsystemInstance()* *W/Unity : UnityEngine.XR.ARFoundation.ARInputManager:OnEnable()* *W/Unity :* *W/Unity : No active UnityEngine.XR.ARSubsystems.XRPlaneSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.* *W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager3:GetActiveSubsystemInstance() W/Unity : UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3:EnsureSubsystemInstanceSet()
@LuisJavierLopez DId you create a bug in the Unity Issue tracker? If so, could you please post a link to the bug? I’m dealing with this issue and this is critical to making an XR app. Quite frustrating
Digging into this myself, I found for the system to start up XRGeneralSettings.Instance.Manager.activeLoader must be set to the loader we just started with XRLoader.Start(). There is no way for the end user to set this value. It’s Set Private inside a sealed class. activeLoader is only set in two places in the code. InitializeLoader() and InitializeLoaderSync(). Both if which will error out when called after XRLoader.Start()
The only way I could get this work was to hack the XRGeneralSettings code. To change activeLoader to public set sop I can manually set activeLoader.
It looks like the Unity supplied code sample has never worked. Either it’s broken and untested, or the instructions are missing an important step.
I tested on Adroid using: ARFoundation 4.1.7 Unity 2021.1.28 on Android