Skip to content

Maui Community Toolkit Camera trimming bug #9738

Open
@ne0rrmatrix

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

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
   <TrimmerRootDescriptor Include="ILLink.Descriptors.xml"/>
 </ItemGroup> 

The ILLink.Descriptors.xml

<?xml version="1.0" encoding="UTF-8" ?>
<linker>
  <assembly fullname="Xamarin.AndroidX.Camera.Core" />
</linker>

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Area: LinkerIssues when linking assemblies.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions