Search code examples
androiddagger

Dagger2 annotation processor is not working


I try to use Dagger2 in my Android project; When I use apt, every things is right.But apt is not supported in AndroidStudio 3.0, so I use annotation processor.But no Dagger2 code created after I click "Make Project"; And I'm sure the annotetion processing is enable in AndroidStudio,because the Butterknife annotation processor is all right. the follow is the build.gradle:

dependencies {
    annotationProcessor 'com.google.dagger:dagger-android-processor:2.13'
    compile 'com.google.dagger:dagger-android:2.13'
    compile 'com.google.dagger:dagger-android-support:2.13'
    compile 'com.jakewharton:butterknife:8.6.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}

Solution

  • use this in android studio 3.0 version

    implementation 'com.google.dagger:dagger:2.9'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.9'