We have a project with many modules in Kotlin Android project, for simplicity let’s say
When we build, we get
... Task ':a:compileDebugKotlin' FROM-CACHE ... Task ':b:compileDebugKotlin' FAILED e: ....kt: (17, 13): Cannot find a parameter with this name: id e: ....kt: (21, 22): Type mismatch: inferred type is String? but String was expected e: ....kt: (26, 9): No value passed for parameter 'type'
where a property named
id was renamed to
type and a constructor parameter’s type has changed. (The code compiles for those who didn’t have the previous version checked out)
We tried running
:a:cleanCompileDebugKotlin, running project-wide
clean, deleting .
gradle folder in the project, deleting the affected
build folders, deleting some
~/.gradle/caches/subfolders. Nothing helped, the compilation problem still persisted.
The only thing that helped is running
gradlew --no-build-cache clean assembleDebug once.
Is there a way to clean (or force-refresh) a specific task’s or subproject’s build cache only instead of a full re-build?
gradlew :a:clean a:assembleDebug :b:clean :b:assembleDebug --no-build-cache
is what I would’ve expected to work.