android / android/camera-samples
The selected camera does not support the enabled use cases. Please disable use case and/or select a different camera. e.g. #setVideoCaptureEnabled(false)
- Dominant language
- Kotlin
- Stars
- 5.5k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
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)
at androidx.camera.view.v.x(CameraController.java:7)
at androidx.camera.view.v.w(CameraController.java:1)
at androidx.camera.view.v.a(CameraController.java:8)
at androidx.camera.view.PreviewView.a(PreviewView.java:5)
at androidx.camera.view.PreviewView.setController(PreviewView.java:5)
at com.zoomlion.common_library.ui.camera.view.CameraClockInActivity.a(CameraClockInActivity.java:1)
at com.zoomlion.common_library.ui.camera.view.a.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8668)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
Caused by: java.lang.IllegalArgumentException: Provided camera selector unable to resolve a camera for the given use case
at androidx.camera.lifecycle.f.b(ProcessCameraProvider.java:37)
at androidx.camera.lifecycle.f.a(ProcessCameraProvider.java:2)
Contributor guide
Research direction
Start by tracing the reported failure from PreviewView.setController through CameraController and ProcessCameraProvider, then inspect the calling CameraClockInActivity. Reproduce the exception with the selected camera and enabled use cases; done means the reported camera configuration no longer throws the unresolved-camera error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100