Adding dagger2 and kapt cause compilation error


#1

Hi all,

I have a project that build/compile successfully, after adding dagger2 and kapt to build.gradle,

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

....

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"

    implementation 'com.google.dagger:dagger:2.16'
    kapt 'com.google.dagger:dagger-compiler:2.16'
   ....
}

after syncing and build clean/rebuild I got the following error:

/home/test/android/app/build/tmp/kapt3/stubs/debug/io/github/alishir/test/profile/TestManager.java:7: error: type DeviceManager.DeviceManagerCallback does not take parameters
    private final pkg.test.DeviceManager.DeviceManagerCallback<pkg.test.DeviceManagerCallbacks> mCallback = null;