'Unable to open camera Camerax android (Comparison method violates its general contract!)

getting unusual exception when invoking camera on camerax Exception is as below

Exception: java.lang.IllegalArgumentException: Comparison method violates its general contract!
           at androidx.camera.lifecycle.LifecycleCameraRepository.bindToLifecycleCamera(LifecycleCameraRepository.java:266)
           at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:424)
           at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:275)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source