perf(build): reduce APK size via WebP assets, resource shrinking, and ARM-universal APK - #586
perf(build): reduce APK size via WebP assets, resource shrinking, and ARM-universal APK#586Himanth-reddy wants to merge 4 commits into
Conversation
|
Thanks for working on this — the WebP conversion and resource shrinking are useful, and the size reduction is significant. However, I think distributing one universal APK for all devices would be much easier for users than asking them to choose between several CPU versions. Before merging, please fix these points:
The builds and unit tests pass, and the image conversion looks good. Once these points are fixed, this should be a worthwhile improvement, with one universal download being the clearest option for users. |
|
I agree with the points about the packaging task, font subsetting, and README — those should definitely be fixed before merging. For the universal APK though, I think we can meet the usability concern without shipping the x86/x86_64 binaries. The PR already generates an Since ARVIO is primarily targeting Android/Android TV devices, ARM is by far the relevant architecture for actual users. x86/x86_64 are mainly useful for emulators and development environments. Shipping those binaries in the default universal download means every ARM user carries ~60 MB of architecture-specific native code they'll never execute. So I think the best approach would be to make the ARM-universal APK the single recommended/default download. Users still get the "download one APK and don't worry about the CPU architecture" experience you're looking for, while we avoid the x86 dead weight. We can still keep the individual That gives us:
So I'd suggest keeping the general multi-ABI approach from the PR, but making |
|
The poll has ended, and the users chose to go with a universal APK. I’ll update the PR with a new commit accordingly. |
…P assets, and font subsetting - Enable Gradle ABI splits (arm64-v8a, armeabi-v7a, x86, x86_64) + universal fallback - Enable isShrinkResources on release and staging builds - Strip verbose/debug logs (android.util.Log & AppLogger) in release ProGuard rules - Convert 111 PNG/JPG drawables and banners to WebP (saving 3.29 MB) - Subset Inter variable fonts to Latin/European glyphs (saving ~900 KB)
…itecture split APKs
1cd8601 to
a6db9b9
Compare
|
Following the Discord community poll and the review feedback, this PR has been updated:
|
Summary of Changes
This PR delivers APK size optimizations and streamlines distribution into a single ARM-Universal APK:
📦 Build & Packaging:
• Single ARM-Universal APK: Restricted native ABIs to
armeabi-v7aandarm64-v8a(32-bit and 64-bit ARM), removing ~60 MB of unused x86/x86_64 binaries while supporting 100% of physical Android TV and Fire TV devices with a single download.• Standard Gradle Packaging: Removed ABI splits and custom repackaging tasks, letting Gradle build and sign
app-sideload-*.apknatively without any variant cross-signing issues.• Font Integrity: Kept the full Inter variable font to preserve all characters used by ARVIO's translations (Greek, Cyrillic, Vietnamese).
🚀 Optimizations Included:
• Resource Shrinking: Enabled
isShrinkResources = truefor release/staging builds.• ProGuard / R8 Log Stripping: Enabled
-assumenosideeffectsrules inapp/proguard-rules.profor release builds.• WebP Asset Conversion: Converted 111 drawables (sports cards, rank banners, avatars) from PNG/JPG to WebP (saving ~3.3 MB / 47.1% reduction).
Verification & Measurements
•
./gradlew testSideloadDebugUnitTestpasses 100%.•
./gradlew assembleSideloadDebugbuilds cleanly and producesapp-sideload-debug.apkcontaining onlyarm64-v8aandarmeabi-v7a.• Release APK size is reduced from ~184 MB down to ~65 MB.