Dagger and Kotlin. Dagger doesn't generate component classes

前端 未结 5 1277
无人共我
无人共我 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 21:58

    This issue can be fixed with the bellow change which is different from original answer

    Following will also work well to fix this issue

    with plugins

    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-kapt'
    

    and dependencies

    implementation "com.google.dagger:dagger:$dagger_version"
    implementation "com.google.dagger:dagger-android:$dagger_version"
    implementation "com.google.dagger:dagger-android-support:$dagger_version" 
    kapt "com.google.dagger:dagger-compiler:$dagger_version"
    kapt "com.google.dagger:dagger-android-processor:$dagger_version"
    

    For reference check out this Gist

提交回复
热议问题