dotnet / dotnet/android

Maui Community Toolkit Camera trimming bug

Open
#9,738 11 comments 2 reactions 1 assignee Assigned to @jonathanpeppers View on GitHub
Area: Trimming
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 20h
Merged PRs (30d)
257

Description

### Android framework version

net9.0-android

### Affected platform version

VS 2022, Dotnet Maui 9.102, CommunityTookit Camera

### Description

I am trying to figure out how to fix the Maui Community toolkit Camera package. When in debug mode everything works as expected. In Release mode the Zoom in and out do not work. I have isolated it to the sample app trimming out `Xamarin.AndroidX.Camera.Core`. Adding this to sample app project fixes the bug
```



```
The `ILLink.Descriptors.xml`
```

```
I would prefer to fix the trimming issue and not have to rely on having to ask consumers of a nuget package to add a TrimmerRootDescriptor xml file to csproj. I have included the build Android-arm64 linked folder as a zip file.

[linked.zip](https://github.com/user-attachments/files/18620391/linked.zip)

### Steps to Reproduce

1. Run this project. https://github.com/CommunityToolkit/Maui/tree/main/samples
2. Goto Views, open the camera app in Release mode.
3. Set zoom slider or click to zoom in and out.
4. Issue is that zoom in and out does not work. Everything else works fine.
5. Issue does not occur in Debug mode.

### Did you find any workaround?

Add a ILLinkDescriptors.xml to sample app and that fixes it. Prevent `Xamarin.AndroidX.Camera.Core` from being trimmed.

### Relevant log output

```shell

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.