Skip to content

Bundle libveldrid-spirv.so into Android APK via explicit AndroidNativeLibrary - #211

Merged
winnerspiros merged 1 commit into
masterfrom
copilot/fix-application-crash
Apr 19, 2026
Merged

Bundle libveldrid-spirv.so into Android APK via explicit AndroidNativeLibrary#211
winnerspiros merged 1 commit into
masterfrom
copilot/fix-application-crash

Conversation

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown

ppy.Veldrid.SPIRV ships its Android native library via build/MonoAndroid10/Veldrid.SPIRV.targets. net10.0-android does not import MonoAndroid10 build targets — the old Xamarin TFM is not in the NuGet TFM compatibility fallback chain. Result: libveldrid-spirv.so silently drops out of the APK → DllNotFoundException at shader compilation → startup crash.

Note: ppy modernized this upstream in July 2025 (replacing MonoAndroid10 with runtimes/android-arm64/native/), but no NuGet has been published from that source yet. This workaround can be removed when a new ppy.Veldrid.SPIRV NuGet is available.

Changes

  • osu.Android.props — Added a top-level PackageReference for ppy.Veldrid.SPIRV with ExcludeAssets="buildTransitive;build" and GeneratePathProperty="true" to suppress the dead MonoAndroid10 targets and expose $(Pkgppy_Veldrid_SPIRV) for direct content access
  • AndroidNativeLibrary — Pulls the arm64-v8a .so from the NuGet package content into the APK, same pattern as the existing BASS/FFmpeg native lib bundling
  • Build validation — Extended ValidateFrameworkNativeLibraries target to fail early if libveldrid-spirv.so is missing from the resolved package
<PackageReference Include="ppy.Veldrid.SPIRV" Version="1.0.15-gfbb03d21c2"
                  ExcludeAssets="buildTransitive;build" PrivateAssets="all"
                  GeneratePathProperty="true" />
...
<AndroidNativeLibrary Include="$(Pkgppy_Veldrid_SPIRV)/build/MonoAndroid10/native/arm64-v8a/libveldrid-spirv.so"
                      Abi="arm64-v8a" />

…eLibrary

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/d595c1fe-8425-4816-9bda-1da5c42cefbe

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
@gitar-bot

gitar-bot Bot commented Apr 19, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@winnerspiros
winnerspiros marked this pull request as ready for review April 19, 2026 19:54
Copilot AI review requested due to automatic review settings April 19, 2026 19:54
@winnerspiros
winnerspiros merged commit 6b72fff into master Apr 19, 2026
2 of 16 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bundles libveldrid-spirv.so into the net10.0-android APK to prevent startup crashes caused by ppy.Veldrid.SPIRV relying on legacy build/MonoAndroid10 targets that are not imported by modern .NET for Android.

Changes:

  • Add an explicit PackageReference to ppy.Veldrid.SPIRV with GeneratePathProperty="true" and excluded build targets.
  • Include libveldrid-spirv.so in the APK via AndroidNativeLibrary using $(Pkgppy_Veldrid_SPIRV).
  • Extend ValidateFrameworkNativeLibraries to fail the build early if libveldrid-spirv.so is missing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants