AvaloniaCommunity / Material.Avalonia

Material design in AvaloniaUI
MIT License
839 stars 78 forks source link

Material.Avalonia.DataGrid fails to compile with AoT #391

Closed PerfectlyFineCode closed 3 months ago

PerfectlyFineCode commented 4 months ago

Usage Information

2.1.10 / 11.1.0 / Windows 11

Description

When compiling Material.Avalonia.DataGrid for Android using the standard Avalonia cross-platform template, it fails to compile and throws the error

1>Microsoft.Android.Sdk.ILLink.targets(106,5): Error MSB4096 : The item "Material.Avalonia.DataGrid" in item list "TrimmerRootAssembly" does not define a value for metadata "RootMode".  In order to use this metadata, either qualify it by specifying %(TrimmerRootAssembly.RootMode), or ensure that all items in this list define a value for this metadata.

Doing

   <ItemGroup>
     <TrimmerRootAssembly Include="Material.Avalonia.DataGrid" RootMode="All" />
   </ItemGroup>

Solves nothing, nor does

   <ItemGroup>
     <TrimmerRootAssembly Update="@(TrimmerRootAssembly)" RootMode="Library" />
   </ItemGroup>

That will just make Avalonia fail to compile instead.

Reproduction Steps

  1. Create a new app using cross-platform avalonia template
  2. Install Material.Avalonia.DataGrid
  3. Compile Android in release
  4. You should now get the error during compilation

Expected Behavior

  1. Create a new app using cross-platform avalonia template
  2. Install Material.Avalonia.DataGrid
  3. Compile Android in release
  4. It should successfully compile

Actual Behavior

You should get the error during compilation in Release mode for Android

1>Microsoft.Android.Sdk.ILLink.targets(106,5): Error MSB4096 : The item "Material.Avalonia.DataGrid" in item list "TrimmerRootAssembly" does not define a value for metadata "RootMode".  In order to use this metadata, either qualify it by specifying %(TrimmerRootAssembly.RootMode), or ensure that all items in this list define a value for this metadata.

Regression?

No response

Known Workarounds

No response

Anything else?

No response

Could you help with a pull-request?

No

Is there an existing issue for this?

SKProCH commented 4 months ago

Hmm, interesting. I'll take a look.