Keeping Android app size in check with React Native Upgrades | by Sparsha Saha | Microsoft Mobile Engineering | Medium
Article Summary
Microsoft Teams faced a 1.2 MB app size bloat after upgrading React Native. Here's how they cut it down to just 0.48 MB.
The Microsoft Teams mobile engineering team shares their systematic approach to controlling Android app size during a React Native upgrade from 0.64.2 to 0.68.3. Larger app sizes directly impact downloads and user engagement, making this work critical.
Key Takeaways
- Used Android Studio's APK Analyzer to compare builds and identify size culprits
- Removed unused shared libraries for Fabric and TurboModules (new architecture not enabled)
- Discovered reactnativeutilsjni was duplicate of reactnativejni, contributed fix upstream
- Final result: reduced 1.2 MB increase down to 0.48 MB through strategic exclusions
Through methodical analysis of shared libraries and removing unused new architecture components, Teams reduced their React Native upgrade bloat by 60%.
About This Article
Microsoft Teams found that two shared libraries, reactnativejni and reactnativeutilsjni, were built from the same source code. This created unnecessary duplication in the Android app binary.
Sparsha Saha's team submitted a PR to the React Native repository that removed reactnativeutilsjni entirely and moved all its references into reactnativejni. This standardized the approach across the codebase.
The change reduced app size by 220 KB for all React Native 0.68.3+ apps. It shows how removing redundant components can lead to meaningful optimization gains across the ecosystem.