Skip to content

fix(android): Prevent startup crash by robustly loading rulesets and native libs - #87

Merged
winnerspiros merged 2 commits into
masterfrom
fix-android-startup-crash-8348821197718379664
Feb 21, 2026
Merged

fix(android): Prevent startup crash by robustly loading rulesets and native libs#87
winnerspiros merged 2 commits into
masterfrom
fix-android-startup-crash-8348821197718379664

Conversation

@google-labs-jules

Copy link
Copy Markdown
  • Wrapped native library loading (osu.Android.Native) in a try-catch block within OsuGameActivity.OnCreate. This prevents the application from crashing immediately if the native library (containing Oboe/Vulkan drivers) fails to load (e.g., UnsatisfiedLinkError). The app can now proceed, and specific drivers will gracefully fail later if enabled.
  • Hardened Ruleset Loading: Replaced string-based Assembly.Load("...") with Assembly.Load(typeof(...).Assembly.FullName) wrapped in try-catch.
    • Linker Safety: Using typeof() creates a strong static reference to the ruleset types (OsuRuleset, TaikoRuleset, etc.), ensuring the Xamarin/Android linker does not strip these assemblies in Release builds. This is a common cause of "crash on startup" in deployed APKs.
    • Error Handling: Added logging to capture and non-fatally handle any issues during ruleset preloading.
  • Added Defensive Null Checks: Inserted runtime null checks for Window, WindowManager, and Resources in OnCreate before accessing their properties, replacing Debug.Assert which is removed in Release builds.
  • Async Safety: Wrapped the handleImportFromUris async task body in a try-catch block to prevent unobserved task exceptions from crashing the process.

These changes collectively address the reported "crash on open" issue on the S23 Ultra by handling the most likely causes: stripped assemblies and native library loading failures.


PR created automatically by Jules for task 8348821197718379664 started by @winnerspiros

@google-labs-jules

Copy link
Copy Markdown
Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@winnerspiros
winnerspiros merged commit 0d34dda into master Feb 21, 2026
27 of 30 checks passed
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.

1 participant