Plugin.LocalNotification icon indicating copy to clipboard operation
Plugin.LocalNotification copied to clipboard

Release Build fails on .NET 8

Open ahwm opened this issue 2 years ago • 1 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

ahwm avatar Dec 07 '23 20:12 ahwm

Further searching found this: https://github.com/dotnet/sdk/issues/27492

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

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

ahwm avatar Dec 07 '23 21:12 ahwm

also try version 11.0.1-preview02

thudugala avatar Feb 20 '24 07:02 thudugala

@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?

VinShen avatar Mar 17 '24 14:03 VinShen