---
title: "How Swiggy Saved 3.7 MB by Solving a Vector Drawable Mystery"
description: "An Android APK investigation found high-resolution PNG variants beside vector drawable XML files, although those raster assets had not been added directly to the codebase. The cause was AAPT2 rasterizing vectors that used features unavailable below API 24, including gradients in android:fillColor, despite the app’s minSdkVersion being 23; the generated files could be much larger than their XML sources, and were produced even for unused resources. The described remedy was to remove unused raster-prone assets, use VectorDrawableCompat with app:srcCompat for affected vectors, and tell Gradle and AAPT to use support-library rendering rather than density-specific PNGs. Removing unused assets cut download size by more than 1 MB, while raising minSdkVersion to 24 produced a further 2.7 MB reduction, for 3.7 MB total; similar gains were observed in Toing and Instamart."
---

# How Swiggy Saved 3.7 MB by Solving a Vector Drawable Mystery

[Swiggy](https://yomu.fyi/company/swiggy) · Shivam Gupta · Jul 10, 2026

**Type:** Explainer

## Summary

An Android APK investigation found high-resolution PNG variants beside vector drawable XML files, although those raster assets had not been added directly to the codebase. The cause was AAPT2 rasterizing vectors that used features unavailable below API 24, including gradients in android:fillColor, despite the app’s minSdkVersion being 23; the generated files could be much larger than their XML sources, and were produced even for unused resources. The described remedy was to remove unused raster-prone assets, use VectorDrawableCompat with app:srcCompat for affected vectors, and tell Gradle and AAPT to use support-library rendering rather than density-specific PNGs. Removing unused assets cut download size by more than 1 MB, while raising minSdkVersion to 24 produced a further 2.7 MB reduction, for 3.7 MB total; similar gains were observed in Toing and Instamart.

## Context

The APK contained density-specific PNG files that had not been added directly, increasing download size alongside vector drawable XML files. AAPT2 could rasterize vectors using features unavailable below API 24, including gradients in android:fillColor, even when the resources were unused and shrinkResources was enabled.

## Approach / What changed

The work removed unused vector assets that triggered rasterization, used VectorDrawableCompat with app:srcCompat for affected vectors, configured Gradle and AAPT to rely on support-library rendering, and raised minSdkVersion to 24.

## Takeaways

- A vector asset of approximately 1 KB could produce a rasterized PNG of approximately 50 KB, while several assets generated about 200 KB of PNGs in the bundle.
- AAPT2 generated rasterized PNG assets for unused vector resources, so enabling shrinkResources did not prevent this behavior.
- Removing unused assets reduced download size by more than 1 MB, and raising minSdkVersion to 24 reduced it by a further 2.7 MB.

**Tags:** [Android](https://yomu.fyi/topic/android), [Performance](https://yomu.fyi/topic/performance)

- Source: [Swiggy](https://medium.com/swiggy-bytes/how-swiggy-saved-3-7-mb-by-solving-a-vector-drawable-mystery-d8561877dbca)
- Source URL: https://medium.com/swiggy-bytes/how-swiggy-saved-3-7-mb-by-solving-a-vector-drawable-mystery-d8561877dbca
- Ingested by Yomu: 2026-09-09T13:57:08.911Z

[Read original post](https://medium.com/swiggy-bytes/how-swiggy-saved-3-7-mb-by-solving-a-vector-drawable-mystery-d8561877dbca)
