KotlinCompiler and flag -A


Hello, i have a gradle 3.5 project with kotlin plugin. If i use this code:
tasks.compileKotlin.kotlinOptions.freeCompilerArgs += [
I get error: “e: Invalid argument: -AoutSrgFile=myFolder” when building the project. The same code, but with compileJava works fine. How can I fix this problem? P.s. sorry for my bad english…


In Gradle you can pass arguments to annotation processor with kapt block:

kapt {
    arguments {
        arg("key", "value")

Thanks, it work for me!