https://kotlinlang.org logo
Title
j

Jeremy

08/31/2019, 10:01 PM
I'm converting a script to kotlin dsl. What is the correct syntax of kapt?
kapt("group:name:version")
results in
inferred type is String but Action<KaptExtension> was expected
d

Dominaezzz

08/31/2019, 10:12 PM
That is the correct syntax. I think the calling context has confused the compiler.
As a quick workaround you can do
"kapt"("group:name:version")
.
o

octylFractal

08/31/2019, 10:14 PM
frequently the generated accessors may also not properly generate, in which case "kapt" is the only option
j

Jeremy

08/31/2019, 10:15 PM
Got it. thanks!
g

gildor

09/01/2019, 7:22 AM
frequently
I didn't see cases when type safe accessors are not generated for a long time, most probably you have wrong configuration
Looks that you applying it not in DependencyAware block
g

gildor

09/03/2019, 2:58 PM
Unwrap from Libraries.Android.apply and try again
j

Jeremy

09/03/2019, 4:12 PM
Same issue
g

gildor

09/03/2019, 4:53 PM
Now I see, you use dynamic syntax for kapt configuration, looks that it doesn't work at all, otherwise you could use type safe accessor anyway, looks that something is broken with Kapt application, but not sure what, everything looks fine for me
Probably somehow related on that you use MPP plugin