Include the following details (edit as applicable):
- Issue category: Semantic Segmentation / Real-time Mapping-Depth / Developer Tools / / Scanning Framework
- Device type & OS version: Android
- Host machine & OS version: Windows
- Issue Environment : On Device
- Xcode version:
- ARDK version: 3.13.0-2504092018
- Unity version: 6000.0.46.f1
Description of the issue:
I’m developing an app where the user can switch between a 3D mode and an AR mode. Starting out in 3D mode by default I can activate AR mode without a problem. However switching back and forth I get numerous exceptions/errors when restarting AR mode.
This is thrown once:
InvalidOperationException: Cannot set camera configuration because you have not disposed of all XRCpuImage and allowed all asynchronous conversion jobs to complete
Niantic.Lightship.AR.Loader.LightshipARCoreLoader.UpgradeCameraConfigurationIfNeeded () (at <00000000000000000000000000000000>:0)
Niantic.Lightship.AR.Utilities.MonoBehaviourEventDispatcher+PrioritizingEvent.InvokeListeners () (at <00000000000000000000000000000000>:0)
These are thrown repeatedly afterwards four several seconds at least:
[Error] [2025-07-03 10:10:33.597] [537231580336] Failed to upgrade the camera configuration to the required minimum resolution. We only expect this to happen when the ARSession was reset when not all camera images were disposed. Check the exception from ARCoreCameraSubsystem to verify that is the case,and if so, make sure to dispose all camera XRCpuImages before resetting the ARSession.
Niantic.Lightship.AR.Utilities.Logging.NativeApi:Lightship_ARDK_Unity_Log(LogLevel, String, String, Int32, String)
Niantic.Lightship.AR.Loader.LightshipARCoreLoader:UpgradeCameraConfigurationIfNeeded()
Niantic.Lightship.AR.Utilities.PrioritizingEvent:InvokeListeners()
The mode switch is done by disabling the parent AR GameObject and enabling the parent 3D GO essentially. The ARSession instance is Reset() on restart which seems to trigger the error.
I found the messages source in LightshipARCoreLoader.cs:189 and the supposed functionality to cover the case in SubsystemDataAcquire.cs:143.
I’m not using any XRCpuImage instances myself. In the meantime I even disabled the occlusion manager, semantics manager and mesh managers to no avail. It seems that as soon as Lightship manages AR, this problem occurs.
I did try calling ARSession.Reset() in a Coroutine after disabling the corresponding component and waiting a frame but it didn’t change the fact.
Any help would be appreciated.