I use .kts
Gradle files (Kotlin Gradle DSL) and the kotlin-kapt
plugin but I still get a script compilation error when I use Ivanov Maksim's answer.
Unresolved reference: kapt
For me this was the only thing which worked:
android {
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments = mapOf("room.schemaLocation" to "$projectDir/schemas")
}
}
}
}