Dagger and Kotlin. Dagger doesn't generate component classes

前端 未结 5 1272
无人共我
无人共我 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:09

    UPDATE FOR KOTLIN 1.1.4

    generateStubs does not work anymore. Feel free to make a build with the latest Kotlin and it would tell you in the Messages section of Android Studio that it is not necessary anymore. Here's an up-to-date list of dependencies for Dagger2 for Android and Kotlin

    apply plugin: 'kotlin-kapt'
    
    //...
    // Other Gradle stuff
    //...
    
    dependencies {
        compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.4-3"
    
        compile 'com.google.dagger:dagger-android:2.12'
        kapt 'com.google.dagger:dagger-android-processor:2.12'
        compileOnly 'com.google.dagger:dagger:2.12'
        kapt 'com.google.dagger:dagger-compiler:2.12'
    }
    

提交回复
热议问题