Skip to content

Fix DllNotFoundException: bass — APK bundles Linux libbass.so instead of Android build - #210

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

Fix DllNotFoundException: bass — APK bundles Linux libbass.so instead of Android build#210
winnerspiros merged 1 commit into
masterfrom
copilot/fix-apk-crash-issue

Conversation

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown

The APK contains the Linux ARM64 libbass.so (261 KB, links libc.so.6) instead of the Android ARM64 version (323 KB, links libOpenSLES.so). The ppy.osu.Framework.NativeLibs NuGet's runtimes/linux-arm64/native/ leaks into the APK via the .NET RID fallback chain (android-arm64 → android → unix), silently overriding the correctly declared AndroidNativeLibrary items.

Changes

  • osu.Android.props: Add ExcludeAssets="native" on ppy.osu.Framework.NativeLibs to block NuGet from contributing any .so files — the correct Android-built libraries come from AndroidNativeLibrary pointing at the framework submodule's arm64-v8a/ directory.

  • release.yml: Add ABI verification step that extracts libbass.so from the built APK and asserts it links libOpenSLES.so (Android audio API), catching wrong-platform .so inclusion at build time.

Before/after

# BEFORE — Linux libbass.so in APK
readelf -d libbass.so | grep NEEDED
  libc.so.6, libdl.so.2, libpthread.so.0, libm.so.6   ← crashes on Android

# AFTER — Android libbass.so in APK
readelf -d libbass.so | grep NEEDED
  libOpenSLES.so, libandroid.so, libc.so, libm.so, libdl.so   ← correct

…ss.so

The ppy.osu.Framework.NativeLibs NuGet package ships Linux ARM64 native
libraries (libbass.so linking libc.so.6, libpthread.so.0). The .NET RID
fallback chain for android-arm64 resolves these Linux .so files into the
APK, overriding the correctly declared AndroidNativeLibrary items that
point to the Android-built versions (linking libOpenSLES.so, libandroid.so).

Fix: Add ExcludeAssets="native" PrivateAssets="all" to the NativeLibs
package reference in osu.Android.props to prevent NuGet from contributing
any native .so files. The correct Android libraries are supplied via
AndroidNativeLibrary from the framework submodule.

Also adds ABI verification to the release workflow to detect this class
of error (wrong platform .so in APK) in future builds.

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/9d91747c-8581-4e17-b3d8-a44994850fd3

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:28
Copilot AI review requested due to automatic review settings April 19, 2026 19:28
@winnerspiros
winnerspiros merged commit e0506bf into master Apr 19, 2026
1 of 15 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

Fixes an Android startup crash (DllNotFoundException: bass) caused by the APK accidentally bundling the Linux ARM64 libbass.so from ppy.osu.Framework.NativeLibs via RID fallback, overriding the intended Android-native libraries from the framework submodule.

Changes:

  • Suppress NuGet-provided native assets for ppy.osu.Framework.NativeLibs so desktop .so files can’t leak into the APK.
  • Add a CI verification step to assert the extracted libbass.so from the built APK is the Android build (links libOpenSLES.so).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
osu.Android.props Adds ExcludeAssets="native" (and PrivateAssets="all") to prevent NuGet native runtime assets from being packaged into the APK.
.github/workflows/release.yml Adds an ABI/platform sanity check on libbass.so extracted from the built APK to catch wrong-platform native libraries during CI.

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

- name: Verify native libraries in APK
run: |
APK="${{ steps.find_apk.outputs.apk_path }}"
SUBMOD="submodules/osu-framework/osu.Framework.Android/arm64-v8a"

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

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

SUBMOD is defined but never used in this step. Please remove it, or use it (e.g., to compare the extracted libbass.so against the submodule copy) to avoid dead code and confusion when maintaining the workflow.

Suggested change
SUBMOD="submodules/osu-framework/osu.Framework.Android/arm64-v8a"

Copilot uses AI. Check for mistakes.
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