fix(android): correct framework assembly names in Linker.xml to prevent startup crash - #320
Merged
Conversation
…tartup crash Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/b85fb8ac-4183-4adf-bd5c-eff96a2a7eb4 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
winnerspiros
May 8, 2026 23:33
View session
There was a problem hiding this comment.
Pull request overview
Fixes an Android startup crash caused by ILLink not applying Linker.xml preservation rules due to using NuGet package IDs instead of CLR assembly names for the osu-framework assemblies.
Changes:
- Update
osu.Android/Linker.xmlto preserveosu.Frameworkandosu.Framework.Androidusing their CLR assembly names (and document the package-ID vs. assembly-name distinction). - Update an
OsuGameActivitycomment to reflect the correct crash root cause.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| osu.Android/OsuGameActivity.cs | Updates a startup/orientation-related comment to point at the linker descriptor fix as the crash root cause. |
| osu.Android/Linker.xml | Corrects framework <assembly fullname="..."> entries to match CLR assembly names so ILLink preservation applies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
APK crashes on launch with
NotSupportedException: Could not activate JNI Handle ... as managed type 'osu.Android.OsuGameActivity'becauseAndroidGameActivity's(IntPtr, JniHandleOwnership)JNI-activation constructor is stripped by ILLink.Root cause
Linker.xmlspecified the framework assemblies by their NuGet package IDs, but ILLink's<assembly fullname="...">matches against the CLR assembly name (<AssemblyName>in the csproj) — these are not the same:ppy.osu.Frameworkosu.Frameworkppy.osu.Framework.Androidosu.Framework.AndroidThe mismatch meant ILLink stored the
preserve="all"rules but never matched them against the assemblies in the link set.osu.Framework.Androidwas freely trimmed, strippingAndroidGameActivity's(IntPtr, JniHandleOwnership)constructor. On startup, the source-generatedOsuGameActivityJNI constructor callsbase(javaReference, transfer)→MissingMethodException→ wrapped as the observedNotSupportedException.(
ppy.Veldrid.SPIRVis unaffected — its package ID and assembly name are identical.)Changes
osu.Android/Linker.xml— correct the two broken entries; expand comment to document the package-ID vs. assembly-name distinction explicitly so this mistake is not repeatedosu.Android/OsuGameActivity.cs— update stale comment that blamed the wrong root cause