-
Notifications
You must be signed in to change notification settings - Fork 0
Fix BASS DllNotFoundException crash on Android startup #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
|
||||||||||||||||||||||||||||||||||||||
| <!-- 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." /> |
There was a problem hiding this comment.
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"againstunzip -loutput;greptreats$LIBas a regex and will also match similarly-named entries (e.g. a hypotheticallibbass.so.debugwould satisfylibbass.so). To make this check robust, consider listing file names only (e.g.unzip -Z1) and using fixed-string / exact matching (e.g.grep -Fand matching the fulllib/arm64-v8a/$LIBpath).