Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable incremental build for kapt

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?

like image 847
sockeqwe Avatar asked Apr 20 '16 09:04

sockeqwe


Video Answer


1 Answers

You can add

kotlin.incremental=false

to your gradle.properties file to disable the incremental building.

like image 130
MrChaz Avatar answered Sep 30 '22 16:09

MrChaz