Android Kotlin : Error Unresolved reference: DaggerAppComponent

前端 未结 4 405
悲哀的现实
悲哀的现实 2021-02-02 08:39

I have installed Kotlin plugin today into an existing project with Dagger 2. Before Kotlin was installed I had no issues with Dagger. However, now the compiler complains :

4条回答
  •  [愿得一人]
    2021-02-02 09:07

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

    And in your dependencies:

    implementation "com.google.dagger:dagger:2.x"
    implementation "com.google.dagger:dagger-android:2.x"
    implementation "com.google.dagger:dagger-android-support:2.x"
    kapt "com.google.dagger:dagger-compiler:2.x"
    kapt "com.google.dagger:dagger-android-processor:2.x"
    

提交回复
热议问题