Error: cannot find symbol variable DaggerAppComponent

后端 未结 8 1825
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-19 08:50

While trying to integrate latest Dagger 2 version, I am facing problem of Dagger auto generation. Dagger is not auto generating DaggerAppComponent in spite of several Rebuilds a

相关标签:
8条回答
  • 2021-02-19 09:41

    Seems like I was using the wrong dependencies:

    compile 'com.google.dagger:dagger-android:2.x'
    compile 'com.google.dagger:dagger-android-support:2.x' // if you use the support libraries
    annotationProcessor 'com.google.dagger:dagger-android-processor:2.x'
    

    The above dependencies should be used if you are using classes in dagger.android.

    The correct dependencies are:

    compile 'com.google.dagger:dagger:2.x'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
    
    0 讨论(0)
  • 2021-02-19 09:44

    needs to run your APP once to generate "DaggerAppComponent"

    0 讨论(0)
提交回复
热议问题