https://kotlinlang.org logo
#kapt
Title
# kapt
i

iseki

07/31/2020, 3:42 PM
Hello, even I use
kapt{ annotationProcessor("foo.bar.Aprocessor") }
. The gradle show me that Can't find annotation processor. Before that, I use
kapt/compileOnly("com.google.auto.service:auto-service:1.0-rc7")
in the processor build file. And use
kapt/compileOnly(project("codegen", "default"))
in the parent project (which use the annotation in fact.) Thank you for your help.
✔️ 1
😫 2
f

Foso

07/31/2020, 4:05 PM
Just use kapt("foo.bar.Aprocessor") and you need to apply the plugin https://kotlinlang.org/docs/reference/kapt.html
i

iseki

07/31/2020, 4:09 PM
I applied this plugin And:
Copy code
Supplied String module notation 'space.iseki.codegen4vertx.Codegen' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:ja
vadoc'.
When I use
kapt("space.iseki.codegen4vertx.Codegen")
@Foso
I try to use
compile
compileOnly implementation
... But it not works also. The kapt said it can't find the annotation processor...
f

Foso

07/31/2020, 4:17 PM
Where are you getting the dependency from? MavenCentral, JCenter, is it local on your computer?
i

iseki

07/31/2020, 4:18 PM
It's child module.
include("codegen")
f

Foso

07/31/2020, 4:25 PM
try kapt project(":codegen")
i

iseki

07/31/2020, 4:30 PM
Yeah. I have tried.
But it's not working too.
I checked the Meta file. It's correctly. But kapt don't invoke my processor. If I declare it explicit. Kapt/gradle said it's not exists...
f

Foso

07/31/2020, 4:36 PM
Don't know if this helps, but in this project, i used an annotation processor from an module https://github.com/Foso/ExtensionGenerator
i

iseki

07/31/2020, 4:39 PM
I use it like you exactly.😥 Only difference is I put the
app
as the parent module
Ah. There is another different. My kotlin version is
1.4.0-rc
Thank you for your help.
Problem solved. I'm foolish. I wrote
@AutoService(AbstractProcessor::class)
instead of
@AutoService(Processor::class)
😫
🎉 2
3 Views