Managing Dependency Hell in a 400-Module Android Project
Article Summary
Erdem Topak from Flink reveals how their Android team scaled from 30 to 437 modules—then discovered 400 unused dependencies silently killing their build times. Here's how they built a custom solution when existing tools failed.
Flink's Android project grew to support 15 engineers working simultaneously, but dependency management spiraled out of control. With 4,652 total dependencies across 437 modules, popular tools like the Dependency Analysis Gradle Plugin required 48GB of memory and 2-3 hours to run, then broke their build. They needed a better approach.
Key Takeaways
- Custom Gradle plugin removed 400 unused dependencies, cutting build times by 15%
- Binary search validation safely removes dependencies in O(log n) time
- ASM bytecode analysis detects actual class usage, not just text parsing
- CI integration runs in 30 seconds, preventing future dependency bloat
- pub/impl/wire/test module pattern enabled 15 engineers to work conflict-free
Critical Insight
Building a custom dependency analyzer delivered 15% faster builds and removed 400 unused dependencies in a fraction of the time existing tools required.