Reducing Android app size in practice at LinkedIn | by Chao Zhang | Microsoft Mobile Engineering | Medium
Article Summary
LinkedIn reduced their Android app size by 27.5MB through aggressive optimization. Here's how they did it without compromising features.
Chao Zhang from LinkedIn's mobile team shares battle-tested techniques for Android app size reduction. This goes beyond the standard documentation to cover advanced strategies that delivered measurable results at scale.
Key Takeaways
- Play Feature Delivery saved 17MB by making video meeting SDK on-demand
- R8 optimization and obfuscation combined reduced size by 8.5MB
- Android App Bundle adoption was smooth; Feature Delivery had testing challenges
- 25% of crashes showed different stacktraces after R8 optimization
- Jetpack Compose will decrease app size long-term despite initial 740KB increase
LinkedIn achieved significant app size reduction through Play Feature Delivery, R8 optimization, and strategic resource management, backed by quantitative analysis proving correlation between app size and install rates.
About This Article
LinkedIn enabled R8 optimization with stack trace obfuscation, which broke error grouping in their crash reporting tool. About 25% of crashes with lambda groups showed different stack traces after the optimization turned on.
Chao Zhang's team fixed this by switching to the retrace tool that comes with the latest R8 version instead of using the standalone command-line tool. The bundled version updates more frequently and has the latest bug fixes.
When LinkedIn upgraded to Android Gradle Plugin 4.1, they saw an unexpected 6MB reduction in app size. This happened because the R class is no longer kept by default. It showed the value of testing preview versions of AGP.