Modular Folders Aren't Architecture: Android Projects Miss the Dependency Rules
On Android, unclear dependency boundaries double the cost of upgrading libraries and threading models; a change meant for the data layer ripples into ViewModels and UI. Enforcing these boundaries keeps swap costs low and prevents modular projects from masquerading as good design.
Dependency relationships, not folder trees, define an Android project's architecture. Splitting code into `:common`, `:user`, `:order` and clean `ui/`, `repository/`, `data/` subpackages only answers where each file sits. It says nothing about who may depend on whom, which dependencies are forbidden, or where a change should stop. A project can have an immaculate directory tree and still be riddled with circular dependencies and responsibility leaks.
Dependency inversion is the mechanism that turns physical separation into architectural separation. A ViewModel should depend on a `UserRepository` abstraction, not on Retrofit or Ktor. The data layer owns IO scheduling, translates framework exceptions into domain errors, manages its own lifecycle, and wraps callbacks into `suspend` functions or `Flow`. When those boundaries hold, swapping an HTTP client or database stays contained inside the data layer; when they leak, every caller pays for the implementation detail.
The trap is over-engineering in the name of architecture. Creating a Module, UseCase, Repository, DataSource, Factory, and Manager for a single feature often adds dozens of classes that jump between each other without introducing any real boundary. Simple package organization can be the better design. With AI generating more of this boilerplate, the scarce skill is judging why a boundary exists and who owns a scope.
The gap between tidy file structure and dependency rules explains why many Android projects with beautiful modules still accumulate technical debt.
More abstractions can be as harmful as no abstractions; a boundary is only worth creating if it isolates a real change.
As AI reduces the cost of writing boilerplate, architectural judgment becomes the primary limiting factor in Android development.