Optimize Android APK: always build Release, drop x86, enable IL stripping + compression - #198
Conversation
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/889cf07f-39f1-4d9f-9240-efd8b66dcec9 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
…ing globally, scope FixRuntimePackAssetTypes to Release Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/9be0d878-9a19-4b9c-9898-2f248dbaa673 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
…ipping + assembly compression + no PDBs, extractNativeLibs=false Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/6c00b3f6-2221-4709-82d4-f20de45c479e Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/6c00b3f6-2221-4709-82d4-f20de45c479e Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
|
@copilot can you check the ci that are failing and warnings we got? |
Checked the CI (run ppy#1427). Here's the breakdown: ✅ All builds pass:
❌ Test failures (pre-existing flakes, unrelated to our changes):
None of these failures or warnings are related to our Android build/signing/optimization changes. All Android-related CI jobs pass cleanly. |
…Size16KBCompatibilityCheck=false in some build orderings Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/77a5ac41-5b04-4959-b12f-a4d0e166e898 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Android build configuration and release workflow to reduce APK size and standardize on Release builds, including removing x86 outputs and enabling additional Release-only size optimizations.
Changes:
- Drop x86 ABI builds (native library build + managed RuntimeIdentifiers) and document the new ABI policy.
- Switch the release workflow to always publish Release (signed when secrets available) and improve APK discovery/reporting.
- Enable additional Release-only APK size optimizations (IL stripping after AOT, assembly compression, no PDBs) and set
extractNativeLibs=false.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
osu.Android/osu.Android.csproj |
Removes x86 native library inclusion and updates comment to match new ABI set. |
osu.Android/AndroidManifest.xml |
Sets android:extractNativeLibs="false" to support smaller/faster installs. |
osu.Android.props |
Removes x86 runtime identifier, adds Release size optimizations, and adjusts page-size warning suppression + patching behavior. |
.github/workflows/release.yml |
Builds native libs for arm64/arm32 only, always publishes Release, and improves APK lookup + size output. |
Comments suppressed due to low confidence (1)
osu.Android.props:39
- With PatchElfPageSizeEnabled set to false globally, build/PatchElfPageSize.targets still runs the PatchAndroidNativeLibPageSize target and evaluates the recursive NuGetPackageRoot glob every build, even though the PatchElfPageSize task is skipped. Consider gating the target/item glob on PatchElfPageSizeEnabled (or similar) to avoid unnecessary work when patching is disabled.
<PatchElfPageSizeEnabled>false</PatchElfPageSizeEnabled>
</PropertyGroup>
<!-- Patch NuGet-provided .so files that ship with 4 KB ELF alignment to 16 KB.
See build/PatchElfPageSize.targets for details.
TODO: Remove once ppy.Veldrid.SPIRV ships 16 KB-aligned native libraries. -->
<Import Project="$(MSBuildThisFileDirectory)build\PatchElfPageSize.targets" />
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| The XA0141 warning is therefore expected and harmless. | ||
| AndroidPageSize16KBCompatibilityCheck=false should suppress the check, but Android SDK | ||
| 36.1.53 still emits XA0141 in some build orderings, so we also add it to NoWarn. --> |
Uh oh!
There was an error while loading. Please reload this page.