Closed Vegen closed 5 years ago
例如
@FragmentScope @Component(modules = [TestModule::class]) interface TestComponent { fun inject(fragment: TestFragment) }
要是 TestModule 是用 kotlin 写的就会报找不到 TestModule这个类
TestModule 里的 TestContract要是用kotlin写, 也会报找不到 TestContract
另附 gradle 配置
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' .....省略 api rootProject.ext.dependencies["dagger2"] kapt rootProject.ext.dependencies["dagger2-compiler"]
app的gradle也要写 kapt rootProject.ext.dependencies["dagger2-compiler"]! 终于解决了
例如
要是 TestModule 是用 kotlin 写的就会报找不到 TestModule这个类
TestModule 里的 TestContract要是用kotlin写, 也会报找不到 TestContract
另附 gradle 配置