Describe the bug
Please add a clear description of what the bug is, and fill the list below.
CameraView version: 2.6.2
Camera engine used: camera2
Reproducible in official demo app: yes
Device / Android version: Redmi Note 7, Android 9
To Reproduce
Steps to reproduce the behavior, possibly in the demo app:
1.Run the Demo App
2.Swtich to front camera
3.Then Crash
Expected behavior
Should run normally
XML layout
Part of the XML layout with the CameraView declaration, so we can read its attributes.
android:id="@+id/camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="88dp"
android:keepScreenOn="true"
app:cameraExperimental="true"
app:cameraEngine="camera2"
app:cameraPreview="glSurface"
app:cameraPlaySounds="false"
app:cameraGrid="off"
app:cameraFlash="auto"
app:cameraAudio="on"
app:cameraFacing="back"
app:cameraGestureTap="autoFocus"
app:cameraGestureLongTap="none"
app:cameraGesturePinch="none"
app:cameraGestureScrollHorizontal="none"
app:cameraGestureScrollVertical="none"
app:cameraMode="picture"
app:cameraUseDeviceOrientation="false"
app:cameraAutoFocusMarker="@string/cameraview_default_autofocus_marker">
Screenshots
None
Logs
2020-04-13 12:51:52.416 18921-18962/com.otaliastudios.cameraview.demo E/CameraEngine: onConfigureFailed! Session android.hardware.camera2.impl.CameraCaptureSessionImpl@ee3a5e9
--------- beginning of crash
2020-04-13 12:51:52.417 18921-18962/com.otaliastudios.cameraview.demo E/AndroidRuntime: FATAL EXCEPTION: CameraViewEngine
Process: com.otaliastudios.cameraview.demo, PID: 18921
java.lang.RuntimeException: onConfigureFailed! Session android.hardware.camera2.impl.CameraCaptureSessionImpl@ee3a5e9
at com.otaliastudios.cameraview.engine.Camera2Engine$4.onConfigureFailed(Camera2Engine.java:584)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.lambda$onConfigureFailed$1(CallbackProxies.java:64)
at android.hardware.camera2.impl.-$$Lambda$CallbackProxies$SessionStateCallbackProxy$gvbTsp9UPpKJAbdycdci_ZW5BeI.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.os.HandlerThread.run(HandlerThread.java:65)