an error occurred by CameraX.bindToLifecycle()

前端 未结 5 2073
执念已碎
执念已碎 2021-01-02 06:54

java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 0. May be attempting to bind too many use cases.

5条回答
  •  太阳男子
    2021-01-02 07:29

    You are binding more UseCases than your device's camera supports. Not all devices can support two ImageAnalyzers.

    Try reducing your analyzers,

    CameraX.bindToLifecycle(lifecycleOwner, mPreview, imageCapture or videoCapture)
    

    I have tested with many devices, so far, among the devices that I tested, only Google Pixel 1 works with three analyzers.

    To suggest a hack, remove imageCapture analyzer, try to get images from preview for imageCapture and use videoCapture.

    Hope it helps.

提交回复
热议问题