hi, everyone. I'm trying to figure out why my buil...
# android
i
hi, everyone. I'm trying to figure out why my builds take so long in Gradle, and going through the gradle profile output, it seems like kaptGenerateStubsDebugKotlin, kaptDebugKotlin, compileDebugKotlin are always executed even if no code changes. Is that just unavoidable?
n
No, those tasks should stay up to date if you haven’t made any changes. I think something brakes incremental compilation in your project, have you tried profiling your build with buildscan tool?
i
Thanks Nikolay, I'm running that now. It looks like maybe ObjectBox is regenerating all entity classes for some reason... Not sure if that's a cause or a symptom, though.
I do see in the gradle output:
Copy code
> Task :app:kaptDebugKotlin
[ObjectBox] Starting ObjectBox processor (debug: true)
[ObjectBox] Parsing entity ConvoyCommanderSummary...
[ObjectBox] Checking for all-args constructor for ConvoyCommanderSummary...
[ObjectBox] Checking constructor ConvoyCommanderSummary(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,long)...
[ObjectBox] Valid all-args constructor found
[ObjectBox] Parsing entity ConvoySummary...
[ObjectBox] Checking for all-args constructor for ConvoySummary...
[ObjectBox] Checking constructor ConvoySummary(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,long)...
[ObjectBox] Checking constructor ConvoySummary()...
[ObjectBox] No all-args constructor found for ConvoySummary
[ObjectBox] Parsing entity ConvoyVehicleSummary...
[ObjectBox] Checking for all-args constructor for ConvoyVehicleSummary...
[ObjectBox] Checking constructor ConvoyVehicleSummary(ja
...which makes me think ObjectBox is the guilty party, but I don't know if maybe something changed something elsewhere.
n
Buildscan should show cause for running each task if you click on it. Maybe it will give you some tips. Also it might worth to check your build.gradle script for something suspicious, e.g. passing a dynamic argument to buildConfigField