Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Build fails on .NET 8 #459

Closed
ahwm opened this issue Dec 7, 2023 · 3 comments
Closed

Release Build fails on .NET 8 #459

ahwm opened this issue Dec 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ahwm
Copy link

ahwm commented Dec 7, 2023

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 ahwm added the bug Something isn't working label Dec 7, 2023
@ahwm ahwm changed the title Build fails on macOS, .NET 8 Release Build fails on .NET 8 Dec 7, 2023
@ahwm
Copy link
Author

ahwm commented Dec 7, 2023

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>

@thudugala
Copy link
Owner

also try version 11.0.1-preview02

@VinShen
Copy link

VinShen commented Mar 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants