java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 0. May be attempting to bind too many use cases.
为什么bindToLifecycle()
只选择imageCapture
或videoCapture
?
CameraX.bindToLifecycle(lifecycleOwner, mPreview, imageCapture,videoCapture)
最佳答案
您绑定(bind)的用例比您设备的摄像头支持的要多。并非所有设备都可以支持两个 ImageAnalyzer。
尝试减少你的分析器,
CameraX.bindToLifecycle(lifecycleOwner, mPreview, imageCapture or videoCapture)
我已经用很多设备进行了测试,到目前为止,在我测试的设备中,只有 Google Pixel 1 可以使用三个分析器。
建议破解,删除 imageCapture 分析器,尝试从 imageCapture 的预览中获取图像并使用 videoCapture。
希望对您有所帮助。
关于android - CameraX.bindToLifecycle() 发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57126429/