Closed titovnick closed 3 years ago
It seems like there's a problem with Dex files. Are you using multidex in your app? I assume that you have the LocationOwner
as a transitive dependency of the app
module, right? You're importing the other module as api
and not implementation
.
Thanks for your answer! This particular interface live in the API module and as far as I can see it is being imported with implementation project(':api')
. We do use Multidex, but as minSdk is 21, we do not use support multidex.
That might be the issue, try with api project(':api')
AGP doesn't give Hilt or Dagger enough information for the annotation processor so api
needs to be used. This is currently under investigation and the team plans to improve it. Was implementation
working with Dagger?
Yes, it works for dagger right now. Will try with 'api' and will write you back
Okay, with api project(':module')
it works, but had to replace two or three in order to make it work. Why do you think it works for Dagger but not for Hilt? Thanks for your help, will never figure it out myself.
I'm surprised that it worked for Dagger, to be honest. Not sure if it wasn't picking up the right implementation or what but we've seen problems like it in the past with Dagger.
This is a known problem that the team is trying to fix as using api
in these cases is not a good practice. Hope it gets fixed in the upcoming released. Stay tuned :)
Hi,
I started migrating our multi-modular application written with Dagger 2 + Dagger Android to Hilt, but faced one issue. I migrated Application class, put aliases for scopes, added aggregation module. Everything compiles and looks fine. Then I started to migrate modules and after adding first AndroidEntryPoint annotation to activity started getting
LocationOwner is just an interface that some Activites extends, not even the one that I am currently migrating. If I remove it, it will start complaining on other interfaces inside the app with the same ClassNotFoundException.
Haven't found anything related in the documentation, have no idea why it is happening.
Will appreciate any help, thanks!