Fix Android startup crash caused by JNI activation failure in trimmed builds - #166
Conversation
… builds Aggressive .NET trimming in .NET 10 was stripping the JNI activation constructor for OsuGameActivity, leading to a System.NotSupportedException on launch. Changes: - Added explicit JNI constructor (IntPtr, JniHandleOwnership) to OsuGameActivity. - Migrated game and input handler initialization to the JNI constructor. - Added [UnconditionalSuppressMessage] to OsuGameActivity to silence trimmer warnings. - Updated Linker.xml to preserve all types in the osu.Android assembly. - Added Linker preservation for both possible AndroidGameActivity namespaces to ensure compatibility with framework versions.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
… builds Aggressive .NET trimming in .NET 10 was stripping JNI registration metadata for OsuGameActivity, leading to a System.NotSupportedException on launch. Changes: - Added [UnconditionalSuppressMessage] to OsuGameActivity to silence trimmer warnings. - Updated Linker.xml to preserve all types in the osu.Android assembly. - Explicitly specified TrimmerRootDescriptor in osu.Android.csproj to ensure the .NET ILLink trimmer honors Linker.xml preservation for JNI activation. - Added Linker preservation for both possible AndroidGameActivity namespaces to ensure compatibility with framework versions.
… builds Aggressive .NET trimming in .NET 10 was stripping JNI registration metadata for OsuGameActivity, leading to a System.NotSupportedException on launch. Changes: - Added [UnconditionalSuppressMessage] to OsuGameActivity to silence trimmer warnings. - Updated Linker.xml to preserve all types in the osu.Android assembly via wildcard. - Explicitly specified TrimmerRootDescriptor in osu.Android.csproj to ensure the .NET ILLink trimmer honors Linker.xml preservation. - Added Linker preservation for both possible AndroidGameActivity namespaces to ensure compatibility with framework versions.
Aggressive .NET trimming in .NET 10 was stripping the JNI activation constructor for OsuGameActivity, leading to a System.NotSupportedException on launch.
Changes:
PR created automatically by Jules for task 17469659687026419914 started by @winnerspiros