Using Dagger2 and Kotlin, my component class implementations are not being generated when other calling code exists. When no calling code exists, the implementations are generated.
E.g.
val comp = DaggerMyComponent.create()
Causes the build to fail, DaggerMyComponent
is not generated and thus cannot be found
// val comp = DaggerMyComponent.create()
The DaggerMyComponent
class is generate and can be viewed on disk, the build succeeds.
I've tried Dagger 2.0.1, 2.0.2, 2.1-Snapshot, using Kotlin beta-1103. I can post my gradle file, source code, or stack trace if needed.
Has anyone encountered this issue before?
It's a step in the build process that generates source files from other files, e.g. generating Java source files from XML schema files (JAXB). – Andreas.
The “maven-source” plugin is used to pack your source code and deploy along with your project. This is extremely useful, for developers who use your deployed project and also want to attach your source code for debugging.
In your app's build file, make sure you added
kapt {
generateStubs = true
}
some example projects can be found here
https://github.com/damianpetla/kotlin-dagger-example/tree/master/app https://github.com/burntcookie90/KotlinDaggerDataBinding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With