"Camera device no longer alive" crash on Android Pie with Unity development build settings.

0 votes
asked Nov 14, 2019 by ngc6543 (1,670 points)

Hey,

Today I tried to build EasyAR 3.0.1 with Unity project, and set the 'Development build' option to true for debugging.

The app crashes while trying to open a camera.

2019-11-14 14:59:27.674 18650-18778/com.---.--- E/CameraCaptureSession: Session 0: Exception while stopping repeating:
    android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): cancelRequest:454: Camera device no longer alive
        at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:731)
        at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:95)
        at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1144)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:527)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:738)
        at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:243)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: android.os.ServiceSpecificException: cancelRequest:454: Camera device no longer alive (code 4)
        at android.os.Parcel.createException(Parcel.java:1964)
        at android.os.Parcel.readException(Parcel.java:1918)
        at android.os.Parcel.readException(Parcel.java:1868)
        at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.cancelRequest(ICameraDeviceUser.java:393)
        at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:93)
        at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1144)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:527)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:738)
        at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:243)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)

This only happens if the 'Development build' option is on. Disabling it and the app runs fine, EasyAR is initialized without a problem.

The tested devices are LG AndroidOne reference phone (LM-Q927L) and a custom Android board (Odroid-N2). Both runs Android Pie, and both have the same result.

I've never encountered this kind of exception before, so I'm wondering if anyone using EasyAR has similar issue with 'Development build' option.

Please log in or register to answer this question.

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...