I’m working on an Android project with multiple build flavors and we’re using dagger and kapt.
Whenever we’re switching branches we will always have build errors if we don’t to a gradle clean. The cause is kapt because it has in it’s cache generated/compiled classes from the other branch. This never happend with gradle when we weren’t using kotlin in our project.
It also happens if we modify classes related to dependency injection: modules, components or annotated constructors/singletons; in such a way that requires to regenerate some classes for the dependency injection to work. Kapt is probably not very aware of those changes and it won’t clear it’s cache.
I honestly don’t know what’s causing it so I can’t create a sample project where this happens but I can reproduce it very easily on my project.
What could be the problem? How can I help you help me? Is there a --debug switch for kapt to see where it checks for changes?