Dagger and Kotlin. Dagger doesn't generate component classes

前端 未结 5 1270
无人共我
无人共我 2021-02-06 21:29

I\'m new with kotlin and Dagger. I have a little problem that I do not how to solve and I don\'t find a solution.

So this is what I have:

@Module
class A         


        
5条回答
  •  北海茫月
    2021-02-06 22:05

    I don't know when this change happened, but on 1.1.2 of the Kotlin gradle plugin you replace this (in your module's build.gradle):

    kapt {
        generateStubs = true
    }
    

    with this:

    apply plugin: 'kotlin-kapt'
    

    and then make sure to replace dependencies that use annotationProcessor with kapt.

    For example, the old way would be to use:

    annotationProcessor (
        'some.library:one:1.0'
        ...
        'some.library.n:n.0'
    )
    

    and now you use:

    kapt (
        'some.library:one:1.0'
        ...
        'some.library.n:n.0'
    )
    

提交回复
热议问题