Sep 24, 2025
Reducing React Native App Size with Spotify Ruler & ProGuard
Learn how to reduce React Native app size using Spotify Ruler, ProGuard, and resource shrinking for faster installs, better performance, and higher user adoption.
Author


Book a call
Table of Contents
Reducing App Size in React Native: A Deep Dive with Spotify Ruler & Proguard
Why App Size Matters
- User Retention and Acquisition: According to studies, users are less likely to download apps above a certain size threshold, especially in regions where data plans are expensive or network connectivity is slow.
- Performance: A leaner app often results in faster installs, reduced memory consumption, and improved runtime performance.
- Play Store and App Store Ranking: Optimized apps are more likely to get recommended, as both stores track app performance metrics.
- Update Adoption: Smaller update packages mean that users can quickly upgrade to the latest version without hesitation.
Step 1: Analyzing App Size with Spotify Ruler
Then, apply the plugin in your android/app/build.gradle:
Step 2: Enabling ProGuard for Bytecode Optimization
This ensures that when you build your release version, ProGuard minifies the code and strips away any unused logic, resulting in a smaller build.
Step 3: Shrinking Resources
- minifyEnabled: Enables ProGuard to shrink bytecode.
- shrinkResources: Removes unused resources.
- proguardFiles: Uses the default ProGuard configuration along with a custom rules file to fine-tune optimizations.
Step 4: Configuring Ruler for Custom Analysis
You can further customize Ruler to simulate different runtime environments. Add the following configuration at the end of your android/app/build.gradle:
- abi: Specifies the CPU architecture (e.g., ARM64).
- locale: Sets the language/region (e.g., English).
- screenDensity: Simulates the pixel density of the target device.
- sdkVersion: Matches the compile SDK version of your project.
Step 5: Running the Analysis Command
Once you’ve set up the Ruler plugin and Gradle configurations, you can generate a size report for your release bundle. Navigate to the android folder of your project and run:

After:-

A Closer Look at Spotify Ruler
- Size Breakdown: Categorizes app size into code, resources, assets, and native libraries.
- Change Tracking: Helps you see how app size evolves over multiple builds.
- Configuration Options: Allows customization for ABI, locale, and screen density.
- CI/CD Integration: Can be integrated into your continuous integration pipeline to prevent sudden spikes in app size.
Additional Strategies for Reducing App Size
- Use Vector Drawables Instead of PNGs
Vector graphics scale better and consume less space than multiple PNG assets. - Load Large Assets Dynamically
Instead of bundling heavy media files in your app, consider fetching them from a CDN on-demand. - Remove Unused Dependencies
Audit your package.json and Gradle dependencies to remove unnecessary libraries. - Use Android App Bundles (AAB)
AAB allows the Play Store to deliver only the resources and binaries required for a specific device, reducing the installed size. - Enable Hermes Engine
For React Native apps, enabling the Hermes JavaScript engine can reduce the APK size and improve runtime performance.

Business Impact of App Size Reduction
- Increased Downloads: A smaller app is more attractive to users with limited storage.
- Reduced Uninstall Rate: Users are less likely to uninstall apps that don’t hog device storage.
- Cost Efficiency: Smaller apps reduce bandwidth costs for both developers (distribution) and users (downloads/updates).
- Improved App Store Ratings: A smoother, faster app often results in higher ratings and reviews.
Conclusion
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Jun 17, 2026
Google I/O 2026 Mobile Playbook: AI Studio, Android CLI, and Antigravity for App Development

Jun 3, 2026
How US Fintech Companies Are Modernizing Legacy Banking Systems Without Full Rebuilds

May 14, 2026
Building a Production-Ready Image Cropper in React Native

Apr 14, 2026
The Keyboard Bounce of Death: Handling Inputs on Complex React Native Screens

Mar 3, 2026
Performant Vertical Feed in Expo: HLS Caching on iOS

Jan 27, 2026