You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[camera] changing camera while recording causes a crash due to disconnected AVOutput #194344
Which throws NSInvalidArgumentException because it has no connection.
The fix is simply change the code to videoCaptureSession.addInput(captureVideoInput), which would automatically add the frontCameraInput -> capturePhotoOutput connection.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
hellohuanlin commentedon Oct 14, 2026
This is a bug in https://github.com/flutter/packages/blob/ac2db9cfeaf69c5064739e0d477ef8cb9c19cd35/packages/camera/camera_avfoundation/darwin/camera_avfoundation/Sources/camera_avfoundation/DefaultCamera.swift#L1258
Before switching camera, the capture session has:
When switching camera input, we remove video input and output, but left photo output untouched. So at this point the capture session has:
Now when adding back the camera input, we simply do:
So our capture session ends up with:
Then a subsequent code calls
Which throws NSInvalidArgumentException because it has no connection.
The fix is simply change the code to
videoCaptureSession.addInput(captureVideoInput), which would automatically add the frontCameraInput -> capturePhotoOutput connection.[camera]fix a crash when switching camera while recording due to disc…
github-actions commentedon Oct 30, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.