我尝试在我的项目中AssistedInject
使用 Dagger 2 ( https://github.com/square/AssistedInject ) 实现 Jake Wharton's。
错误:找不到符号 @dagger.Module(包括 = {InflationInject_ViewModule.class})
似乎ViewModule
生成的代码不知道在哪里可以找到InflationInject_ViewModule
:
@InflationModule
@Module(includes = [InflationInject_ViewModule::class])
abstract class ViewModule
我的 build.gradle 的相关位是
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {...}
dependencies {
implementation "com.google.dagger:dagger-android:2.16"
implementation "com.google.dagger:dagger-android-support:2.16"
kapt "com.google.dagger:dagger-compiler:2.16"
kapt "com.google.dagger:dagger-android-processor:2.16"
implementation 'com.squareup.inject:inflation-inject:0.3.0'
kapt 'com.squareup.inject:inflation-inject-processor:0.3.0'
}
我已经检查InflationInject_ViewModule
过生成的代码中确实存在(在build/generated/source/kapt/devDebug/com/project/di/
,所以也许这与编译器查找源集/生成的代码的位置有关。
有什么建议么?