https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
e

Emanuel Moecklin

03/07/2024, 4:23 PM
If I use Anvil in a Gradle library module, does it have to be a direct dependency of the app module to have the Anvil generated modules (for the library) being included in the app Dagger components? We have a situation like this
app -> uses Anvil
|--- library a -> doesn't use Anvil
|--- library b -> uses Anvil
Even when we enable Anvil in library a, modules generated for library b aren't included in the app and the app crashes. We don't want to add every single library to the app module directly so is there a way to have transitive dependencies with Anvil?
r

ralf

03/07/2024, 4:28 PM
Use
api
dependencies and not
implementation
, then it’ll work.
e

Emanuel Moecklin

03/07/2024, 4:31 PM
so api in library a? like
api :library-b?
r

ralf

03/07/2024, 4:41 PM
Yes
4 Views