CommunityToolkit / CommunityToolkit/Maui

[BUG] CameraView FlashModes "Auto" and "On" throwing CameraExceptions on some Android devices

Open
#3,141 0 comments 0 reactions 1 assignee Claimed by @VladislavAntonyuk View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

We are facing some problems when using the CameraView with FlashMode set to "Auto" or "On". Whenever the flashlight turns on, the CameraView throws a CameraException after up to 10 seconds on some Android devices.

At the moment, this seems to mainly affect the Samsung Galaxy A-series, but not all models. My private phone (A54 5G) has no problems, while we know that the A53 5G and A56 5G show the described behavior.

I created a small example project on GitHub to reproduce the issue:
[TestMauiCamera](https://github.com/KonstantinKellermann/TestMauiCamera/tree/main)

Maybe we are missing something, or this could be related to specific Android or One UI versions. We are not sure how to handle this and hope you might be able to help us.

### Expected Behavior

The photo should be taken without throwing any exceptions with and without using the flashlight.

### Steps To Reproduce

1. Open and run the reproduction repository on an affected device
- Alternatively, create a simple project using CameraView with flash enabled using the latest .NET MAUI and CommunityToolkit versions
2. Take a photo
(The photo is not saved in the reproduction repository. It is only meant to reproduce the exception.)
3. Use the FlashMode "On" or "Auto"
4. On affected devices, the exception is thrown after up to 10 seconds.

### Link to public reproduction project repository

https://github.com/KonstantinKellermann/TestMauiCamera/tree/main

### Environment

```markdown
- .NET MAUI CommunityToolkit: 14.0.1
- .NET MAUI CommunityToolkit-Camera: 6.0.0
- OS: Android 16
- .NET Version: 10.0.101
- .NET MAUI Controls: 10.0.41
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.