Since android gradle plugin has enabled incremental build by default annotation processing breaks, because only those classes who has been changed since last incremental build will be taken into account from annotation processors.
So for java source code we usually use apt
grald plugin to run annotation processing. However, android's gradle plugin automatically disables gradle's incremental build feature if apt
is used in the same project:
https://github.com/google/dagger/issues/298
Now I'm working on a kotlin project and Im facing the same incremental build issue with kapt
. So the solution, as with apt
, is to disable incremental build. The documentation says:
android {
compileOptions.incremental = false
...
}
However, that doesn't work for me. Does anybody know how to disable incremental builds?
You can add
kotlin.incremental=false
to your gradle.properties
file to disable the incremental building.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With