I tired to use Dagger with Kotlin. I noticed that ...
# announcements
j
I tired to use Dagger with Kotlin. I noticed that class are not generated. When I run Gradle in command line I get "'kapt.generate stubs' is not used by the 'kotlin-kapt' plugin". Anyone know why?
g
Remove
kapt.generate stubs
from your build.gradle. It’s not needed anymore But it’s just warning, not an error. Try to build and check your build logs
j
I find out that the Class is generated but not show in Intellij. If I tried
DaggerClassCopoment
, it cannot reference the class
g
Is it Java project?
j
It is a Kotlin and Gradle project (not Android)
I can see the class in /build/generated/source/kapt/package/. But I cannot reference it even with full name.
g
Yes, that what I mean. You should add idea gradle plugin and add generated dir to sourceSets. Cannot find code snippet fast, try to google it
j
Thx, I just added the sourceSets myself
😀