Project requires same repositories defined as library module

I have an app module and a lib module. I would like the lib module to be completely distinct from the app module.

Currently the lib module is responsible for defining the repositories and dependencies it uses. When I try to build the app project, which uses the lib module as a project dependency I get errors:

Could not resolve all files for configuration ':app:debugCompileClasspath'
>  Could not find
Searched in the following locations:
Required by:
    project :app > project :lib

If in my rootProject, I add the same repository definitions as in my lib project, but under the allProjects configuration, the build succeeds. I don’t want to do this though as it couples the projects in a way that I don’t want. It also makes the lib project’s dependencies harder to change.

Here’s a sample project that I’ve narrowed this down to the barebones. I’ve been running

gradle assembleDebug

to perform the build. (370.1 KB)

I’ve also created an issue in Google’s issue tracker.