Skip to content

Android: fix 9 build annotation warnings (Linker.xml stale entries + IL2075) - #316

Merged
winnerspiros merged 1 commit into
masterfrom
copilot/fix-build-annotations-issues
May 8, 2026
Merged

Android: fix 9 build annotation warnings (Linker.xml stale entries + IL2075)#316
winnerspiros merged 1 commit into
masterfrom
copilot/fix-build-annotations-issues

Conversation

Copilot AI commented May 8, 2026

Copy link
Copy Markdown

The last Android APK build emitted 5 "Could not resolve assembly" linker warnings and 4 IL2075 trim-analysis warnings across OboeAudioRedirector.cs and OsuGameAndroid.cs.

Linker.xml — remove 5 unresolvable assembly entries

Entry Reason removed
ppy.osu.Framework / ppy.osu.Framework.Android ILLink in .NET Android Full-link mode cannot locate net10.0 NuGet assemblies during the android-TFM trimmer pass. Entries had zero effect; assemblies are preserved intact because ILLink can't trim what it can't find.
Realms.PlatformHelpers Merged into Realm assembly in v11+. Realm 20.x doesn't ship it separately.
Microsoft.Extensions.Configuration Only .Abstractions is in the build closure; base package is not.
Microsoft.Extensions.Http Not referenced by this project.

Each removed entry now has an inline comment explaining the omission.

IL2075 suppressions

The Roslyn trimming analyzer warns when GetMethod is called on a Type obtained via GetType() or BaseType (neither carries [DynamicallyAccessedMembers]). The targets are preserved via osu.Android preserve="all" in Linker.xml, so the warnings are false positives. Suppressed with targeted #pragma warning disable IL2075:

  • OboeAudioRedirector.csenqueueOnAudioThread and triggerMixerRecreation (BaseType-walking reflection loops)
  • OsuGameAndroid.csDispose (activeMixersList.GetType().GetMethod(...))

@gitar-bot

gitar-bot Bot commented May 8, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@winnerspiros
winnerspiros marked this pull request as ready for review May 8, 2026 21:03
Copilot AI review requested due to automatic review settings May 8, 2026 21:03
@winnerspiros
winnerspiros merged commit 28b6d50 into master May 8, 2026
24 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces Android Release build noise by removing stale/unresolvable Linker.xml entries and adding targeted suppressions for false-positive trim-analysis warnings (IL2075) around intentional reflection usage.

Changes:

  • Remove Linker.xml <assembly> entries that cannot be resolved (stale/unused assemblies) and document the omissions inline.
  • Suppress IL2075 warnings in two reflection loops in OboeAudioRedirector and one reflective call site in OsuGameAndroid.Dispose().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
osu.Android/OsuGameAndroid.cs Adds a targeted IL2075 suppression around a reflective GetMethod() used during disposal.
osu.Android/OboeAudioRedirector.cs Adds targeted IL2075 suppressions around base-type-walking reflection lookups.
osu.Android/Linker.xml Removes stale/unresolvable assembly entries and replaces them with explanatory comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2753 to +2757
if (activeMixersList != null && activeMixersHandler != null)
{
try
{
#pragma warning disable IL2075 // activeMixersList is typed as object — runtime type is known to be an INotifyCollectionChanged-derived BindableList, preserved by Linker.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants