Skip to content

Commit 78dbc42

Browse files
authored
Merge pull request #209 from winnerspiros/copilot/fix-osu-framework-crash
Fix BASS DllNotFoundException crash on Android startup
2 parents 6f5a1e0 + 0048ecd commit 78dbc42

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)