Skip to content

Fix Android native Vulkan initialization and missing Oboe symbols - #76

Merged
winnerspiros merged 1 commit into
masterfrom
fix-android-native-crash-6435091698266272558
Feb 8, 2026
Merged

Fix Android native Vulkan initialization and missing Oboe symbols#76
winnerspiros merged 1 commit into
masterfrom
fix-android-native-crash-6435091698266272558

Conversation

@winnerspiros

Copy link
Copy Markdown
Owner

Fixes Android startup crash caused by missing native symbols and incorrect JNI object handling in Vulkan initialization.


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

- Modify `osu.Android/Native/vulkan_renderer.cpp`:
  - Add `JNI_OnLoad` to capture `JavaVM*`.
  - Rename `nVulkanInitialize` to `nVulkanInit` (flat C export) to match C# P/Invoke.
  - Update `nVulkanInit` to accept a JNI `jobject` (Surface), retrieve `JNIEnv` using `JavaVM`, and convert the Surface to `ANativeWindow*` using `ANativeWindow_fromSurface`.
- Modify `osu.Android/Native/oboe_audio.cpp`:
  - Add missing `nOboeStop` export to match C# P/Invoke.
- Modify `osu.Android/OsuGameActivity.cs`:
  - Add `GetSurface()` helper to find the active `SurfaceView` and return its `Surface`.
- Modify `osu.Android/OsuGameAndroid.cs`:
  - Update `VulkanRenderer.Initialize` call to pass `gameActivity.GetSurface().Handle` (or `IntPtr.Zero`), ensuring a valid JNI Surface handle is passed to the native library instead of a Window handle.

This fixes `EntryPointNotFoundException` for `nVulkanInitialize` (renamed) and `nOboeStop`, and fixes the invalid pointer usage (segfault) by correctly handling JNI Surface objects in the native layer.

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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 2dffba8 into master Feb 8, 2026
32 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