If a module declares a dependency as api, implementation, etc, but only uses that dependency in tests, ModuleCheck will report that dependency as unused.
Instead, that dependency should be demoted to testImplementation or androidTestImplementation.
Technically the same should be applied to other build flavor dependencies, like debug.