首先配置Gradle,app下的Gradle加入Dagger2依赖

implementation 'com.google.dagger:dagger-android:2.26'
implementation 'com.google.dagger:dagger-android-support:2.26'
implementation 'com.google.dagger:dagger:2.26'
kapt 'com.google.dagger:dagger-compiler:2.26'
kapt 'com.google.dagger:dagger-android-processor:2.26'

并且应用kotlin-apt插件,之后就可以开始享受dagger2配合上MVP所带来的快乐啦

Last modification:February 5th, 2020 at 10:30 pm
If you think my article is useful to you, please feel free to appreciate