Skip to content

perf(build): reduce APK size with ABI splits, resource shrinking, WebP assets, and font subsetting - #586

Open
Himanth-reddy wants to merge 3 commits into
ProdigyV21:mainfrom
Himanth-reddy:perf/apk-size-optimizations
Open

perf(build): reduce APK size with ABI splits, resource shrinking, WebP assets, and font subsetting#586
Himanth-reddy wants to merge 3 commits into
ProdigyV21:mainfrom
Himanth-reddy:perf/apk-size-optimizations

Conversation

@Himanth-reddy

@Himanth-reddy Himanth-reddy commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

This PR implements comprehensive APK size optimizations and multi-tier architecture builds:

📦 Generated APK Variants:

  1. arm64-v8a Split APK: Dedicated lightweight APK containing only 64-bit ARM binaries (Shield TV, Google TV Streamer, Fire TV Cube).
  2. armeabi-v7a Split APK: Dedicated lightweight APK containing only 32-bit ARM binaries (Fire TV Sticks, Mi Box, smart TVs).
  3. arm-universal APK: 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).
  4. universal APK: Full universal fallback containing all 4 architectures (arm64-v8a, armeabi-v7a, x86, x86_64).
  5. x86 / x86_64 Split APKs: For developer PC emulators.

🚀 Optimizations Included:

  • Resource Shrinking: Enabled isShrinkResources = true for release/staging builds.
  • ProGuard / R8 Log Stripping: Enabled -assumenosideeffects rules in app/proguard-rules.pro for release builds.
  • WebP Asset Conversion: Converted 111 drawables (sports cards, rank banners, avatars) from PNG/JPG to WebP (saving 3.29 MB / 47.1% reduction).
  • Font Subsetting: Subsetted the Inter variable fonts to Latin/European characters, saving ~900 KB.

Verification & Measurements

  • ./gradlew testSideloadDebugUnitTest passes 100%.
  • ./gradlew assembleSideloadDebug outputs:
    • arm64-v8a Debug APK: 76.3 MB (~45 MB Release)
    • armeabi-v7a Debug APK: 68.6 MB (~38 MB Release)
    • arm-universal Debug APK: 90.8 MB (~65 MB Release)
    • universal Debug APK: 156.0 MB (~125 MB Release, was 184 MB)

…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)
@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Aug 18, 2026

Copy link
Copy Markdown
Owner

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:

  1. The custom ARM packaging task scans all existing APK outputs. I reproduced a release build re-signing the existing debug ARM APK with the release key; the reverse could also leave a release APK debug-signed and cause update/install failures. Please scope packaging to the current variant only, preferably using Gradle's normal APK generation instead of manually rewriting/re-signing ZIP contents.
  2. The subsetted Inter font removes 137 characters currently used by ARVIO's Greek, Cyrillic and Vietnamese translations. Please include all characters used by the shipped languages, or keep the full font.
  3. Update the README because app-sideload-debug.apk is no longer generated.

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.

@Himanth-reddy

Copy link
Copy Markdown
Collaborator Author

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 arm-universal APK containing both armeabi-v7a and arm64-v8a, and it's around 65 MB release compared to ~125 MB for the full universal APK.

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 arm64-v8a / armeabi-v7a APKs for people who specifically want the smallest possible package, and x86/x86_64 builds can remain available for emulator/developer use if needed.

That gives us:

  • One simple APK for normal users
  • ARM 32-bit + 64-bit compatibility
  • ~65 MB release instead of ~125 MB
  • No unnecessary x86/x86_64 native libraries for real devices
  • Optional ABI-specific builds for users who want them

So I'd suggest keeping the general multi-ABI approach from the PR, but making arm-universal the primary distribution rather than the full 4-ABI universal APK.

@Himanth-reddy

Copy link
Copy Markdown
Collaborator Author

The poll has ended, and the users chose to go with a universal APK. I’ll update the PR with a new commit accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants