thudugala/Plugin.LocalNotification

Release Build fails on .NET 8

ahwm opened this issue · 3 comments

Describe the bug
Oddly, it builds/publishes fine for iOS.

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.43/targets/Microsoft.Android.Sdk.ILLink.targets(106,5): error MSB4096: The item "Plugin.LocalNotification" 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. [/path/to/project.csproj::TargetFramework=net8.0-android]

Same error on Visual Studio 2022 on Windows:

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.ILLink.targets(106,5): error MSB4096: The item "Plugin.LocalNotification" 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.

To Reproduce
dotnet publish project.csproj -f net8.0-android -c Release

Attempt to build release Android with .NET 8

Expected behavior
Build successfully

Platform (please complete the following information):

  • OS: Android
  • Version 34

Additional context
.NET 8.0.100

Further searching found this: dotnet/sdk#27492

So I tried a couple of different values and this ended up working:

	<ItemGroup>
   		<TrimmerRootAssembly Include="Plugin.LocalNotification" RootMode="library" />
	</ItemGroup>

also try version 11.0.1-preview02

@ahwm

Using 11.1.1 Nuget Version on Android OS 14

tried for Release version with AOT and Enable Trimming and

    <ItemGroup>
	<TrimmerRootAssembly Include="Plugin.LocalNotification" RootMode="library" />
</ItemGroup>

The App does build and run but Local Notification events are not fired.

With AOT and Enable Trimming both false, Local Notification works good in Release mode.

Am I missing something?