Skip to content

[camera][ios] app crash on iPad with no flash: flashMode must be set to a value present in the supportedFlashModes array #73726

@johnvuko

Description

@johnvuko

Hi,
since the last version 0.6.4+5 my app crash (directly closed, I get the exception on Firebase) when taking the picture by calling controller.takePicture().

Here the exception:

Fatal Exception: NSInvalidArgumentException
*** -[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] flashMode must be set to a value present in the supportedFlashModes array
-[AVCapturePhotoOutput capturePhotoWithSettings:delegate:]

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1b733a180 __exceptionPreprocess
1  libobjc.A.dylib                0x1b65129f8 objc_exception_throw
2  AVFoundation                   0x1bd414ad0 -[AVCapturePhotoOutput capturePhotoWithSettings:delegate:]
3  camera                         0x1021ee8ac (Manquant)
4  camera                         0x1021f2900 (Manquant)
5  libdispatch.dylib              0x1b6d77a38 _dispatch_call_block_and_release
6  libdispatch.dylib              0x1b6d787d4 _dispatch_client_callout
7  libdispatch.dylib              0x1b6d21324 _dispatch_lane_serial_drain$VARIANT$mp
8  libdispatch.dylib              0x1b6d21e40 _dispatch_lane_invoke$VARIANT$mp
9  libdispatch.dylib              0x1b6d2a4ac _dispatch_workloop_worker_thread
10 libsystem_pthread.dylib        0x1b6f59114 _pthread_wqthread
11 libsystem_pthread.dylib        0x1b6f5bcd4 start_wqthread

The problem is present on my iPad mini 2 / iOS 12.5, this iPad doesn't have a flash.
Works fine on my iPhone 11.

I try to set controller.setFlashMode(FlashMode.off) but it raised an exception saying there is no flash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: productionIssues experienced in live production appsa: tabletTablets and landscape phonesc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processfound in release: 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallywaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions