Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] CameraView crashing when snapping picture with FlashMode set to Torch #1314

@matteovelati

Description

@matteovelati

Description

When using Torch flash mode in a camera view, I'm unable to snap pictures without crashing.

Steps to Reproduce

  1. Create a CameraView with CaptureMode="Photo", CameraOptions="Back", FlashMode="{Binding CameraFlashMode}"
  2. Toggle a button to switch from FlashMode="Off" to FlashMode="Torch"
  3. Snap a picture

Expected Behaviour

I expect to snap a photo having the flash always on (aka Torch mode)

Actual Behavior

The flash mode changes correctly, but when I try to take a photo I get the following exception:

Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] flashMode must be set to a value present in the supportedFlashModes array

Basic Information

  • Version with issue: 1.0.2, 1.2.0 pre-2
  • Last known good version: na
  • IDE: VisualStudio 2019 for Mac
  • Platform Target Frameworks:
    • iOS: 14.4
  • Nuget Packages: Xamarin.Forms 5.0.0.2012, Xamarin.Essentials 1.6.1, NETStandardLibrary 2.0.3, Network.Json 13.0.1
  • Affected Devices: iPhone 6s

Metadata

Metadata

Assignees

No one assigned

    Labels

    a/CameraView 📸bugSomething isn't working. Breaky break.p/iOSiOS platform issue.s/unverifiedThis issue needs verification/reproduction by a team member. PRs cannot be accepted/merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions