Android Black Screen - Wayspot Anchors Template

  • Issue category: ARDK Virtual Studio Tools / Developer Tools / VPS
  • Device type & OS version: Android - Samsung S20FEwith Android 13
  • Host machine & OS version: Windows 10
  • Issue Environment : On Device
  • ARDK version: 2.4.1
  • Unity version: 2020.3.33f1

Bug reproduction steps:
I create a new scene with the “Wayspots Anchors” template. It runs correctly on the Editor with a mock environment, but it shows a black screen when built on the Android phone.

This is the error from the Android logcat:

Error Unity This GfxDevice does not support asynchronous readback
Error Unity InvalidOperationException: Operation is not valid due to the current state of the object.
Error Unity at Niantic.ARDK.AR.Frame._SerializableARFrameBase.CalculateDisplayTransform (UnityEngine.ScreenOrientation orientation, System.Int32 viewportWidth, System.Int32 viewportHeight) [0x00000] in <00000000000000000000000000000000>:0
Error Unity at Niantic.ARDK.Rendering.ARFrameRenderer.UpdateCameraMatrices (Niantic.ARDK.AR.IARFrame frame) [0x00000] in <00000000000000000000000000000000>:0
Error Unity at Niantic.ARDK.Rendering.ARFrameRenderer.UpdateState (Niantic.ARDK.AR.IARFrame withFrame) [0x00000] in <00000000000000000000000000000000>:0
Error Unity at Niantic.ARDK.Extensions.ARRenderingManager.LateUpdate () [0x00000] in <00000000000000000000000000000000>:0

a. I didn’t get any error or black screen with the “Plane Tracker” template.
b. I tried adding an AR Depth Manager script on the ARSceneCamera game object but nothing changed.

Hello George,

I tried building the same Template to my Android device and had a successful build with no black screen issue. Have you tried rebuilding a second time to see if the error still persists? I have seen this error disappear before by simply rebuilding. Can you also double check that the Template does have the AndroidPermissionRequester?

Hello Jesus, thanks for taking the time to answer.

Yes, I have rebuilt it several times, for example after adding an ARDepthManager script or after removing it.
Yes, the template has the AndroidPermissionRequester (with a Camera permission element) on the ARSceneManager game object.

It seems weird because another template (eg the Plane Tracker) works fine.

Hi George,

Thank you for your patience. I am still looking into this. This particular error message is a little hard to track for Android devices. One thing that did come to mind was Multithreaded Rendering. Can you try disabling that to see if the template works?

Go to Edit → Project Settings → Player and look for Multithreaded Rendering. It should be below Color Gamut.

Hello Jesus,

I disabled the Multithreaded Rendering and it didn’t make any difference, the screen was again black.
Any other ideas? :slight_smile:

Hi George,

Thanks for your patience.

By any chance would you be able to try running this example on a Unity 2021.3 version. It looks like 2020 had some issues with this async readback which now seems to be supported in v2021

Hello Jesus,

I could download and try it, but our project is on the 2020.3 version so we would prefer if we could continue on the same version.

Thanks,
George

Hi George,

Braxton has informed me that he has an email thread going on with you and will continue the conversation with you there. There is an alternative but it does come with a few caveats which he will discuss with you via email.

Ok, thank you Jesus.