Android: sometimes black screen shows instead of camera image (inconsistently)

  • Device type & OS version: Android
  • Issue Environment : On Device
  • ARDK version: 2.4.1
  • Unity version: 2021.3.16

I have an app, which uses the plane detection feature of the ARDK. The problem is on certain Android devices (Realme X7 Max, Android version: 12), the camera permission sometime isn’t being asked, and then we get black screen instead of the camera image. Other times the camera permission is being asked, but granting the permission still result in black screen. Other times it works fine. I have an ARSessionManager, CapabilityChecker, AndroidPermissionRequester, ARPlaneMnanager component in my scene.

Here is a scenario from our tester:

  1. When I install and launch the application, the “Camera permission” is not requested and the camera not activated. After killing and relaunching the app the “Camera permission” is requested but the camera is not activated after providing access[Only This time].
  2. In the second attempt, the same issue reproduced. After after killing and relaunching the app, provided access with “While using app” and camera not activated.
  3. In the third attempt, after installing and launching the app, “Camera permission” is not requested and blank screen is displayed. After killing and relaunching the app, “Camera permission” requested and after choosing the “While using the app” option, the camera is activated.

Hello Adam,

Would you be able to build your project again to your Android device, check the Logcat and paste any errors you see here (a screenshot of them works as well) specifically any errors that come up frequently?

Hi Adam,

You can disregard this comment, I’m just putting in a summary of what we discussed on Discord here so that it can be available publicly.

We started by having a look at any logcat issues, specifically any issue that was repeating too much or anything having to do with the Camera. From said logs, I was able to find one of the instances; the camera permissions are granted but no picture shows.

It appeared that on the ARDK side, there were logged messages indicating that the camera permissions were being granted successfully but, somewhere down the logs there were hardware messages that noted that the device ended up not providing the camera feed over to ARDK.

Luckily, it looks like an update from Android 12 to Android 13 fixed the problem. I have not heard back since my last check in on your Discord thread but if the issue has returned please reply over there so we can continue troubleshooting. This appears to be a hardware issue but if it does resurface we can take another look :slight_smile: