java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 0. May be attempting to bind too many use cases.>
A workaround is to bind Preview with VideoCapture, and Preview with ImageCapture separately. Binding Preview, ImageCapture and VideoCapture appears to be an issue on a few devices currently. When switching between the two be careful to unbindAll first.
This may be because the VideoCapture UseCase is not officially supported yet, as of 1.0.0-Beta10.
fun startVideoCapture() {
...
cameraProvider.unbindAll()
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelected,
previewUseCase,
videoCaptureUseCase
)
}
fun startImageCapture() {
...
cameraProvider.unbindAll()
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelected,
previewUseCase,
imageCaptureUseCase
)
}