Fix DllNotFoundException: bass — APK bundles Linux libbass.so instead of Android build - #210
Merged
Merged
Conversation
…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>
Copilot created this pull request from a session on behalf of
winnerspiros
April 19, 2026 19:28
View session
There was a problem hiding this comment.
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.NativeLibsso desktop.sofiles can’t leak into the APK. - Add a CI verification step to assert the extracted
libbass.sofrom the built APK is the Android build (linkslibOpenSLES.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" |
There was a problem hiding this comment.
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" |
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.
The APK contains the Linux ARM64
libbass.so(261 KB, linkslibc.so.6) instead of the Android ARM64 version (323 KB, linkslibOpenSLES.so). Theppy.osu.Framework.NativeLibsNuGet'sruntimes/linux-arm64/native/leaks into the APK via the .NET RID fallback chain (android-arm64 → android → unix), silently overriding the correctly declaredAndroidNativeLibraryitems.Changes
osu.Android.props: AddExcludeAssets="native"onppy.osu.Framework.NativeLibsto block NuGet from contributing any.sofiles — the correct Android-built libraries come fromAndroidNativeLibrarypointing at the framework submodule'sarm64-v8a/directory.release.yml: Add ABI verification step that extractslibbass.sofrom the built APK and asserts it linkslibOpenSLES.so(Android audio API), catching wrong-platform.soinclusion at build time.Before/after