I’m trying to opt-in export of KDoc comments accor...
# multiplatform
m
I’m trying to opt-in export of KDoc comments according to https://kotlinlang.org/docs/whatsnew1520.html#opt-in-export-of-kdoc-comments-to-generated-objective-c-headers However, after adding
Copy code
kotlin {
    targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget) {
        compilations.get("main").kotlinOptions.freeCompilerArgs += "-Xexport-kdoc"
    }
}
to build.gradle, I get the following error during gradle configuration:
Copy code
Caused by: groovy.lang.MissingMethodException: No signature of method: build_85rawsls4t4om6gyhg7yes7kk.kotlin() is applicable for argument types: (build_85rawsls4t4om6gyhg7yes7kk$_run_closure6) values: [build_85rawsls4t4om6gyhg7yes7kk$_run_closure6@6b90c290]
Possible solutions: notify(), toString(), toString(), toString(), toString(), split(groovy.lang.Closure)
Any hint what could be wrong?
g
Got a similar error when I created a
build.gradle
instead of a
build.gradle.kts
m
I was able to get it working by using this configuration instead:
Copy code
kotlin {
    targets {
        configure([iosArm64, iosX64]) {
            compilations.all {
                kotlinOptions {
                    freeCompilerArgs += "-Xexport-kdoc"
                }
            }
        }
    }
}}
👌 1