
A few weeks ago, I was prepping an app for release. Everything was looking good — crash-free sessions were up, Compose code was humming, and I was patting myself on the back for finally implementing that proper ViewModel + Repository flow.
Then I generated the release build.
45 MB.
I blinked.
Cleaned. Rebuilt. Checked again.
Still 45 MB.
That’s when the voice in my head whispered:
“Bro… what are you even shipping in there? A 4K Marvel movie?”
Enter resConfigs — The Unsung Hero of Gradle
Turns out, I was unknowingly packaging every single language and resource Android has ever known.
Arabic? In there.
Zulu? Yep.
Esperanto? Why not.
All because I never told Gradle which locales I actually support.
All I needed was this one-liner in build.gradle:
Legacy and upto AGP 8.0 :
defaultConfig {
...
resConfigs "en", "hi" // Only package English and Hindi
}
Boom. Just like that, Gradle stopped shipping the United Nations inside my APK.
Heads up!
If you’re using Android App Bundles (which is now required for the Play Store), Google Play automatically delivers only the languages your users need — so you might not see much APK size reduction from resConfigs.
Want even more control (AGP 8.0+)? Use the new androidResources block:
android {
androidResources {
localeFilters.addAll(["en", "hi"])
}
}
Either way, no more shipping the United Nations inside your APK.
The Results Were Honestly Ridiculous
After adding just that one line, I rebuilt the app:
- Before: 45.3 MB
- After: 27.1 MB
- Net savings: ~40%
No ProGuard tweaks. No image compression voodoo.
Just one forgotten setting that saved my APK from obesity.
The Hidden Bloat You’re Probably Shipping
Let’s be real — most apps don’t need 100+ language packs unless you’re building for a global audience.
And yet, by default, Android Gradle Plugin bundles them all. Unless you say otherwise, it assumes your app needs to speak Latin, Swahili, and Klingon.
So if you’re targeting just 2–3 locales, it’s pure waste.
Same goes for ABIs. You’re probably only shipping for armeabi-v7a and arm64-v8a. So why ship everything?
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a"
universalApk false
}
}
Use it. Trim it. Ship it.
But heads up !
If you’re using Android App Bundles (required for Play Store), Google Play automatically splits and serves device-specific APKs for you — no manual config needed!
Job Offers
Lessons From My Own Build Blunder
We focus so much on code elegance — SOLID, DI, clean architecture, fancy UI — but when it comes to size, we often leave things bloated and untouched.
And let’s not even talk about Play Store warnings or that one QA guy who keeps saying,
“Why does it take 2 minutes to download on 3G?”
This trick isn’t rocket science. It’s just one overlooked setting that can seriously improve install time and conversion rates — especially in markets where every MB matters.
Before You Go
Go check your build.gradle right now.
If you don’t see resConfigs, you’re probably shipping a lot more than you need.
Optimize early.
Ship lean.
And give that poor release engineer a break.
This article was previously published on proandroiddev.com


