Maybe it's a Android specific, but I think, that maybe it's gradle related.
I described it here: https://issuetracker.google.com/issues/64382147
Demo project: https://github.com/mtrakal/issue64382147
you can just call: ./gradlew build --refresh-dependencies to reproduce this issue.
The error is thrown in the app module, which is missing the required repository. Keep in mind that each project resolves dependencies in isolation, using only its own repositories. The fact that module1 has the right repository does not help app, which doesn't have this repository.
Isn't it bad?
Ouch, I updated module, hmm, some new repositories in module. I need to put it into app. Have no idea why (now I have, but not before).
Correct solution:
We decided not to do this because you would lose control over where the dependencies of your project come from. Choosing your repositories requires trust and it would undermine that trust if other libraries could just bring in new repos.
Most helpful comment
Isn't it bad?
... WHAT, why I can't compile project? Some missing dependencies? WTF, I didn't change anything... :/
Ouch, I updated module, hmm, some new repositories in module. I need to put it into app. Have no idea why (now I have, but not before).
Correct solution: