fix(android): preserve SDL3-CS to stop OsuGameActivity JNI activation crash - #323
Merged
Conversation
…ity JNI activation crash Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/3e3e344a-127e-4c51-b475-cfaa53791766 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
winnerspiros
May 9, 2026 09:45
View session
GHSA-6c8g-7p36-r338) Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/d66bf496-1e05-4255-8811-526afc198199 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
…uppression Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/29c65f29-ab61-4fc1-8533-85179a4caf15 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/d5f7d66b-e601-4c64-8929-91a628166bc5 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/d5f7d66b-e601-4c64-8929-91a628166bc5 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
winnerspiros
approved these changes
May 9, 2026
winnerspiros
approved these changes
May 9, 2026
….0.51) Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/a970ff72-5ae4-4b70-9bb2-0835b7799175 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
winnerspiros
approved these changes
May 9, 2026
There was a problem hiding this comment.
Pull request overview
This PR addresses an Android Release startup crash caused by linker trimming of JNI-activation constructors (via preserving SDL3-CS / SDLActivity), while also updating a range of dependencies and CI tooling versions across the solution.
Changes:
- Android: add explicit preservation/backstops for
SDL3-CS/Org.Libsdl.App.SDLActivityto prevent JNI activation crashes underAndroidLinkMode=Full. - Update NuGet package versions across game, platform, benchmarks, and test/template projects.
- CI: bump ReSharper InspectCode GitHub Action version.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Templates/Rulesets/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions in template test project. |
| Templates/Rulesets/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions in template test project. |
| Templates/Rulesets/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions in template test project. |
| Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions in template test project. |
| osu.iOS/osu.iOS.csproj | Bump Microsoft.Maui.Essentials for iOS. |
| osu.Game/osu.Game.csproj | Bump runtime/test dependencies (SignalR, Sqlite, Sentry, SharpCompress, NUnit, SQLitePCLRaw) and fix a framework-version comment. |
| osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Tests/osu.Game.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Tests.iOS/osu.Game.Tests.iOS.csproj | Bump DeepEqual version for iOS tests. |
| osu.Game.Tests.Android/osu.Game.Tests.Android.csproj | Bump DeepEqual version for Android tests. |
| osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Rulesets.Osu.Tests.iOS/osu.Game.Rulesets.Osu.Tests.iOS.csproj | Bump DeepEqual version for iOS ruleset tests. |
| osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj | Bump Microsoft.NET.Test.Sdk and NUnit versions. |
| osu.Game.Benchmarks/osu.Game.Benchmarks.csproj | Bump nunit package version for benchmarks project. |
| osu.Desktop/osu.Desktop.csproj | Bump System.IO.Packaging and DiscordRichPresence versions. |
| osu.Android/OsuGameActivity.cs | Add DynamicDependency rooting for SDLActivity constructors as a trimming backstop. |
| osu.Android/osu.Android.csproj | Bump Microsoft.Maui.Essentials for Android. |
| osu.Android/Linker.xml | Add SDL3-CS preserve rule + update explanatory comments about JNI ctor trimming. |
| osu.Android.props | Add AndroidLinkSkip entries for osu.Framework.Android and SDL3-CS in Release. |
| Directory.Build.props | Bump Microsoft.CodeAnalysis.BannedApiAnalyzers version. |
| .github/workflows/ci.yml | Bump JetBrains/ReSharper-InspectCode action version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <ItemGroup Label="Package References"> | ||
| <PackageReference Include="System.IO.Packaging" Version="10.0.5" /> | ||
| <PackageReference Include="System.IO.Packaging" Version="10.0.7" /> | ||
| <!-- Held back due to invite bug in newer versions. See https://github.com/Lachee/discord-rpc-csharp/issues/286--> |
Comment on lines
+92
to
+96
| // Belt-and-suspenders: preserve the JNI activation constructor chain that TypeManager.Activate | ||
| // uses when Android creates this Activity: OsuGameActivity → AndroidGameActivity → SDLActivity. | ||
| // The primary guard is AndroidLinkSkip in osu.Android.props (bypasses ILLink entirely for | ||
| // osu.Framework.Android and SDL3-CS). These [DynamicDependency] attributes are a code-level | ||
| // backstop in case AndroidLinkSkip is removed: ILLink's walk from OsuGameActivity() roots |
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.
Uh oh!
There was an error while loading. Please reload this page.