Cash App Nov 18, 2025

Cash Android Moves to Metro

Article Summary

Egor Andreevich just shipped a DI framework migration across 1,500 modules serving tens of millions of users. The build speed improvements? Nearly 60% faster incremental builds.

Cash App's Android team migrated from Dagger/Anvil to Metro, a modern Kotlin-first dependency injection framework. The challenge: doing it safely across a massive production codebase while maintaining the ability to build with both frameworks during the transition.

Key Takeaways

Critical Insight

Cash Android achieved 60% faster incremental builds and eliminated kapt by migrating to Metro while maintaining production stability through a dual-framework build system.

The article reveals the clever Gradle trick they used to instantiate different dependency graphs without changing application code.

About This Article

Problem

Cash Android's 1,500-module codebase used Dagger's Java-based annotation processor, which required kapt. This made the build pipeline complex and blocked the adoption of Kotlin 2.0's K2 compiler, even though it was stable and offered better performance.

Solution

Egor Andreevich's team used Metro's interop functionality to build the codebase in both Dagger/Anvil and Metro modes at the same time. A Gradle property controlled which mode ran, letting them validate both approaches in parallel across CI shards before committing to the full migration.

Impact

Removing kapt and running dependency injection codegen during Kotlin compilation gave Cash Android 58.5% faster incremental builds for non-ABI changes and 16.7% faster clean builds. The team could also adopt the K2 compiler.