I keep getting error when binding cameraX to lifecycle

68 views
Skip to first unread message

Iga n

unread,
Apr 8, 2024, 11:19:52 PMApr 8
to Android CameraX Discussion Group
Hello, currently I'm developing a feature for Scan QR Code that use CameraX library and MLkit (Barcode Scanning). But I notice I keep getting this error on some devices (low and higend) and it happens intermittently :

Fatal Exception: java.lang.IllegalStateException
The selected camera does not support the enabled use cases. Please disable use case and/or select a different camera. e.g. #setVideoCaptureEnabled(false)

Anyway I'm using cameraX library 1.2.0 with CameraController since I don't need advance usage of the camera (basically the feature just scan qr). 

Does anyone ever 
encounter this issue? If so how do you fix this?

Charcoal Chen

unread,
Apr 8, 2024, 11:29:09 PMApr 8
to Iga n, Android CameraX Discussion Group
Hi,

Please use the newer version (1.3.0 above) library to try again. The newer version CameraX libraries support stream sharing (internal implementation) to make devices be able to work well even if four UseCases (Preview + ImageCapture + ImageAnalysis + VideoCapture) are bound.
If the issue still happens after you upgrade the library version, please provide your UseCases' settings and the device names which the issue happens on. Thanks.

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/8c330387-dad9-45bc-ab0b-5f6663c08718n%40android.com.

Iga n

unread,
Apr 8, 2024, 11:38:06 PMApr 8
to Android CameraX Discussion Group, charco...@google.com, Android CameraX Discussion Group, Iga n
Thank you for a very quick response. I'll update the library.

I have another question, can we make a faster camera preview? because on the app that i develop it take almost 3-4s. Which is quite a long waiting time.
Reply all
Reply to author
Forward
0 new messages