Skip to content

Commit 0048ecd

Browse files
fix: use forward slashes in native library paths to fix BASS DllNotFoundException on Android
The AndroidNativeLibrary glob in osu.Android.props used backslash path separators which silently match zero files on Linux CI runners, causing libbass.so and other framework native .so files to be omitted from the APK. Also adds: - MSBuild error target to fail the build if libbass.so is missing - APK verification step in release.yml to catch missing native libs Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/1cb827b2-fc17-462a-b44c-cd932bcd649e Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 6f5a1e0 commit 0048ecd

2 files changed

Lines changed: 41 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,34 @@ jobs:
215215
exit 1
216216
fi
217217
218+
- name: Verify native libraries in APK
219+
run: |
220+
APK="${{ steps.find_apk.outputs.apk_path }}"
221+
echo "Checking APK for required native libraries..."
222+
223+
NATIVE_LIBS=$(unzip -l "$APK" | grep "lib/arm64-v8a/.*\.so" || true)
224+
echo "$NATIVE_LIBS"
225+
echo ""
226+
227+
MISSING=0
228+
for LIB in libbass.so libbass_fx.so libbassmix.so; do
229+
if echo "$NATIVE_LIBS" | grep -q "$LIB"; then
230+
echo "✅ $LIB found"
231+
else
232+
echo "::error::$LIB is MISSING from the APK — the app will crash at startup (DllNotFoundException)."
233+
MISSING=1
234+
fi
235+
done
236+
237+
if [ "$MISSING" -ne 0 ]; then
238+
echo ""
239+
echo "::error::One or more required native libraries are missing. Check that the osu-framework submodule is initialised and the AndroidNativeLibrary glob in osu.Android.props resolves correctly."
240+
exit 1
241+
fi
242+
243+
echo ""
244+
echo "All required native libraries present ✓"
245+
218246
- name: Upload APK artifact
219247
uses: actions/upload-artifact@v7
220248
with:

osu.Android.props

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,27 @@
8585

8686
<ItemGroup>
8787
<!-- Use winnerspiros/osu-framework fork (net10.0-android, optimized) via submodule instead of ppy NuGet package -->
88-
<ProjectReference Include="$(MSBuildThisFileDirectory)submodules\osu-framework\osu.Framework.Android\osu.Framework.Android.csproj" />
88+
<ProjectReference Include="$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/osu.Framework.Android.csproj" />
8989
</ItemGroup>
9090

9191
<!-- Include framework native libraries (BASS audio, FFmpeg, etc.) from the submodule.
9292
When using a NuGet package these are bundled automatically; with a ProjectReference
9393
they must be declared explicitly or the app crashes at startup with
94-
System.DllNotFoundException: bass (or similar). -->
94+
System.DllNotFoundException: bass (or similar).
95+
Use forward slashes — backslash globs silently match zero files on Linux CI runners,
96+
which produces an APK without libbass.so (and the other native libs). -->
9597
<ItemGroup>
96-
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)submodules\osu-framework\osu.Framework.Android\arm64-v8a\*.so" Abi="arm64-v8a" />
98+
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/*.so" Abi="arm64-v8a" />
9799
</ItemGroup>
98100

101+
<!-- Fail the build early if libbass.so is missing.
102+
A missing libbass.so means the app will crash on startup with DllNotFoundException.
103+
This catches silent glob failures (e.g. uninitialised submodule, wrong path). -->
104+
<Target Name="ValidateFrameworkNativeLibraries" BeforeTargets="Build">
105+
<Error Condition="!Exists('$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/libbass.so')"
106+
Text="libbass.so not found in submodules/osu-framework/osu.Framework.Android/arm64-v8a/. Ensure the osu-framework submodule is initialised: git submodule update --init --recursive" />
107+
</Target>
108+
99109
<PropertyGroup>
100110
<!-- Fody does not handle Android build well, and warns when unchanged.
101111
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->

0 commit comments

Comments
 (0)