Skip to content
webtoapkfree

How do I make my APK file smaller?

To reduce APK size, publish an App Bundle, turn on R8 and resource shrinking, convert images to WebP or vectors, and drop libraries you barely use.

GuidesNookesh Karri

Light cover card with the title 'How do I make my APK file smaller?' in dark text and a green accent bar

To reduce APK size, publish an Android App Bundle instead of one big APK, turn on R8 code shrinking and resource shrinking, and convert images to WebP or vector drawables. Then remove libraries you barely use. Measure before and after each step so you know which change paid off.

Start by measuring what takes up space

You can’t shrink what you haven’t measured, so open the file before you change anything. Android Studio’s APK Analyzer shows how much of the file is code, resources, assets and native libraries.

Open it from Build > Analyze APK and sort by size. In most apps one folder dominates: res/ full of images, lib/ full of native code, or classes.dex swollen by libraries. That folder tells you which section below to read first.

How to reduce APK size, ordered by payoff

The fixes below go from the biggest typical win to the smallest. You don’t need all of them. Stop when the size is fine for your users.

1. Ship an App Bundle to Google Play

An App Bundle is the easiest win if you publish on Google Play. Android’s size guide says Play generates optimized APKs for each device configuration, so people download only the code and resources their phone needs.

You still keep a signed APK for testing on your own phone. The bundle is only what you upload. If you’re unsure which file goes where, my post on converting an APK to an AAB walks through it.

2. Turn on R8 and resource shrinking

R8 removes code your app never calls, including unused parts of libraries. The shrink-code guide also says R8 shortens class, field and method names to cut the size of the DEX file.

Add this to the release build type in build.gradle.kts:

buildTypes {
    release {
        isMinifyEnabled = true
        isShrinkResources = true
    }
}

isShrinkResources removes resources nothing references. From Android Gradle Plugin 8.12.0, R8 also optimizes resources, and the guide cites measured improvements of over 50% in app size for that newer resource shrinking. Test the release build afterwards, because shrinking can strip code that’s only reached through reflection.

3. Compress or replace your images

Images are often the biggest folder and the quickest to fix. WebP can compress better than JPEG or PNG and still supports transparency. Android Studio converts images for you with a right-click on the drawable.

Lossy WebP works on Android 4.0 (API level 14) and up. Lossless and transparent WebP need Android 4.3 (API level 18). Almost any app you build today clears both.

For icons and flat shapes, use a VectorDrawable. The size guide says a 100-byte vector file can draw a sharp, screen-sized image. If a PNG has to stay a PNG, tools such as pngcrush, pngquant or zopflipng shrink it with no visible loss.

4. Drop languages and densities you don’t support

Many libraries ship translated strings for dozens of languages. Since Android Gradle Plugin 7.0, you can declare the resource configurations your app supports, and the build leaves the rest out. If your app is English and Hindi only, there’s no reason to carry Finnish strings from a support library.

5. Remove libraries you barely use

A whole library for one helper function is the most common bloat I see. The size guide notes that code shrinking can trim a library but might not remove some large internal dependencies. Swap it for a few lines of your own code, or a smaller library.

One developer took one app from 15MB to under 2MB with this kind of cleanup. Your results will differ.

The current Google Play size limits

Google Play limits are based on compressed download size, calculated when you upload. Play Console Help lists these:

What Limit
Base module (App Bundle) 500MB
Each feature module 500MB
Each asset pack 1.5GB
All modules plus install-time asset packs 4GB
On-demand or fast-follow asset packs 30GB
Legacy APK upload 100MB

Watch out for the older number. Android’s size guide still says Play enforces 200 MB for App Bundles, while Play Console Help and the App Bundle FAQ say 500 MB for the base module. Trust Play Console Help. That’s where the check happens.

200MB still matters for another reason. Above it, people on mobile data see a warning dialog before the install. It doesn’t block them, but it’s one more reason to tap Cancel.

Why WebView apps are usually small already

A WebView app keeps most of its weight on the website, not in the APK. Pages, images and videos load from your server when the app opens, so a heavy home page doesn’t make the download bigger.

That’s how apps from webtoapkfree.com work. A Website section loads the live site, and its content can change without an app update. Only the app name, icon, navigation and any bundled HTML go inside the package. Bundled HTML is capped at 100,000 characters per section, and the HTML importer takes one file up to 100 KB, so a bundled page can’t balloon the APK.

The limitation cuts the other way. Content that loads from the web needs a connection. If you want pages to work offline, they must be bundled, and big images or videos in bundled pages count toward size. Because ZIP and folder imports aren’t supported, an offline image gallery doesn’t fit this builder. My take: keep media on the website and bundle only small text pages.

The app icon is the one image every build carries. Size it to the Android app icon size Play asks for rather than uploading a huge original.

Check the result before you ship

Shrinking can break things quietly, so test the release build, not the debug one. Install it on a real phone using the steps in testing an APK on your phone, and open every screen that uses reflection, a library you trimmed, or an image you converted.

Then run APK Analyzer again and compare it with your first measurement. If a fix saved almost nothing, undo it.

FAQ

What is the biggest single way to reduce APK size?

Publishing an Android App Bundle instead of one universal APK. Google Play then builds an APK for each device configuration, so each phone downloads only the code and resources it needs.

What is the Google Play size limit for an app?

Play Console Help lists 500MB for the base module, measured as compressed download size. Apps that still publish plain APKs have a 100MB limit.

Does R8 make my app smaller?

Yes. R8 removes unreachable code from your app and its libraries and shortens class, field and method names to cut the size of the DEX file. Turn it on with isMinifyEnabled = true in the release build.

Should I convert my PNG images to WebP?

Usually, yes. WebP supports lossy compression and transparency and can compress better than JPEG or PNG. Lossless and transparent WebP need Android 4.3 (API level 18) or higher.

Sources