Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,34 @@ jobs:
exit 1
fi

- name: Verify native libraries in APK
run: |
APK="${{ steps.find_apk.outputs.apk_path }}"
echo "Checking APK for required native libraries..."

NATIVE_LIBS=$(unzip -l "$APK" | grep "lib/arm64-v8a/.*\.so" || true)
echo "$NATIVE_LIBS"
echo ""

MISSING=0
for LIB in libbass.so libbass_fx.so libbassmix.so; do
if echo "$NATIVE_LIBS" | grep -q "$LIB"; then
echo "✅ $LIB found"
else
echo "::error::$LIB is MISSING from the APK — the app will crash at startup (DllNotFoundException)."
MISSING=1
Comment on lines +223 to +233

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.

The verification uses grep -q "$LIB" against unzip -l output; grep treats $LIB as a regex and will also match similarly-named entries (e.g. a hypothetical libbass.so.debug would satisfy libbass.so). To make this check robust, consider listing file names only (e.g. unzip -Z1) and using fixed-string / exact matching (e.g. grep -F and matching the full lib/arm64-v8a/$LIB path).

Copilot uses AI. Check for mistakes.
fi
done

if [ "$MISSING" -ne 0 ]; then
echo ""
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."
exit 1
fi

echo ""
echo "All required native libraries present ✓"

- name: Upload APK artifact
uses: actions/upload-artifact@v7
with:
Expand Down
16 changes: 13 additions & 3 deletions osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,27 @@

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

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

<!-- Fail the build early if libbass.so is missing.
A missing libbass.so means the app will crash on startup with DllNotFoundException.
This catches silent glob failures (e.g. uninitialised submodule, wrong path). -->
<Target Name="ValidateFrameworkNativeLibraries" BeforeTargets="Build">
<Error Condition="!Exists('$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/libbass.so')"
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" />
Comment on lines +101 to +106

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.

ValidateFrameworkNativeLibraries currently checks for the presence of libbass.so on disk, not that it was actually picked up by the AndroidNativeLibrary glob. The original regression (backslash glob matching zero items on Linux) would still pass this check because the file exists in the submodule while the item list is empty, and the APK would still ship without the library. Consider validating that @(AndroidNativeLibrary) contains the required libs (or at least is non-empty / contains libbass) instead of using Exists() on the file path.

Suggested change
<!-- Fail the build early if libbass.so is missing.
A missing libbass.so means the app will crash on startup with DllNotFoundException.
This catches silent glob failures (e.g. uninitialised submodule, wrong path). -->
<Target Name="ValidateFrameworkNativeLibraries" BeforeTargets="Build">
<Error Condition="!Exists('$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/libbass.so')"
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" />
<!-- Fail the build early if the framework native libraries were not picked up by the
AndroidNativeLibrary glob. A missing libbass.so means the app will crash on startup
with DllNotFoundException. This catches silent glob failures (e.g. wrong separators
on Linux CI, uninitialised submodule, wrong path). -->
<Target Name="ValidateFrameworkNativeLibraries" BeforeTargets="Build">
<PropertyGroup>
<_FrameworkNativeLibraryNames>;@(AndroidNativeLibrary->'%(Filename)%(Extension)', ';');</_FrameworkNativeLibraryNames>
</PropertyGroup>
<Error Condition="'$(_FrameworkNativeLibraryNames)' == ';;'"
Text="No AndroidNativeLibrary items were resolved from submodules/osu-framework/osu.Framework.Android/arm64-v8a/*.so. Ensure the path is correct, the osu-framework submodule is initialised (git submodule update --init --recursive), and forward slashes are used in the glob." />
<Error Condition="!$([System.String]::Copy('$(_FrameworkNativeLibraryNames)').Contains(';libbass.so;'))"
Text="libbass.so was not included in @(AndroidNativeLibrary). Ensure the osu-framework submodule is initialised and the native-library glob resolves libbass.so for arm64-v8a." />

Copilot uses AI. Check for mistakes.
</Target>

<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->
Expand Down
Loading