perf(build): reduce APK size with ABI splits, resource shrinking, WebP assets, and font subsetting - #586
Conversation
…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
|
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. |
Summary of Changes
This PR implements comprehensive APK size optimizations and multi-tier architecture builds:
📦 Generated APK Variants:
arm64-v8aSplit APK: Dedicated lightweight APK containing only 64-bit ARM binaries (Shield TV, Google TV Streamer, Fire TV Cube).armeabi-v7aSplit APK: Dedicated lightweight APK containing only 32-bit ARM binaries (Fire TV Sticks, Mi Box, smart TVs).arm-universalAPK: Combines both 32-bit and 64-bit ARM architectures into one installer for users who are unsure which ARM CPU they have (zero x86 dead weight).universalAPK: Full universal fallback containing all 4 architectures (arm64-v8a,armeabi-v7a,x86,x86_64).x86/x86_64Split APKs: For developer PC emulators.🚀 Optimizations Included:
isShrinkResources = truefor release/staging builds.-assumenosideeffectsrules inapp/proguard-rules.profor release builds.Verification & Measurements
./gradlew testSideloadDebugUnitTestpasses 100%../gradlew assembleSideloadDebugoutputs:arm64-v8aDebug APK: 76.3 MB (~45 MB Release)armeabi-v7aDebug APK: 68.6 MB (~38 MB Release)arm-universalDebug APK: 90.8 MB (~65 MB Release)universalDebug APK: 156.0 MB (~125 MB Release, was 184 MB)