Writing
Mobile English

Cutting an APK by More Than Half Without Deleting Features

Every megabyte costs installs in emerging markets. A practical size-reduction pass: split ABIs, shrink resources, audit the big offenders.

  • Published
  • 1 min read
On this page3 sections
  1. Find out where the weight is
  2. The cuts, in order of pay-off
  3. Keep it cut

In markets where storage is tight and data is prepaid, APK size is a conversion metric. Play stats show install completion dropping measurably per 10 MB. Here is the diet that took a production app to well under half its size.

Find out where the weight is

bash
# Android Studio: Build > Analyze APK, or:
unzip -l app-release.apk | sort -k1 -rn | head -20

The breakdown was: 40% native libs (all four ABIs shipped), 25% images (PNGs that should have been vector or WebP), 15% an analytics SDK the app barely used.

The cuts, in order of pay-off

  1. App Bundle + ABI splits. Shipping arm64-v8a to an arm64 phone instead of four ABIs: the single biggest cut, roughly 30% of the original.
  2. shrinkResources + R8 full mode. Dead drawables and unused SDK classes: roughly another 12%.
  3. PNG to WebP / vector. cwebp -q 80 on everything over 50 KB: roughly another 10%.
  4. Audit dependencies. The “barely used” SDK was replaced by 60 lines of code: the last 5% or so.
kotlin
buildTypes.release {
    isMinifyEnabled = true
    isShrinkResources = true
}

Keep it cut

Size regresses silently, so CI enforces a budget: build the bundle, compare against a threshold, fail on +1 MB unexplained. Like structural loads - you do not check a beam once and stop looking. You monitor.