When I run the gradle dependencies command for mylibrary2, the archives configuration fails to retrieve the transient dependencies of the dependent mylibrary1
For the application module, everything works fine. And all other configurations for the mylibrary2 project are successful.
I was able to reproduce this in a brand new project setup, which doesn’t have anything special. Just created the 3 modules above and dependencies between them, so it’s not related to any custom implementation.
Does anyone know why this is happening? And also, what I can do to fix it?
I think the problem is that a android library module cannot depend on another android library module. You should probably factor out the common code from library one in a simple non library project and let both libraries depend on it.
That was my thought too, but I thought maybe there’s something else that might be wrong with that implementation. I can’t apply your suggestion due to the design of the codebase, but it did give me an idea - I’ve changed the type of the dependency module (mylibrary1 from my example above) to a java only library. It seems that it didn’t really need to be an android library module.
So, I now have an application module, a java library module and an android module. The dependency between the android library module and the java library module works fine and the dependencies command succeeds.