如何将软件包从https://google.github.io/dagger/api/2.12/dagger/android/package-summary.html导入Android Studio Project?

问题描述 投票:-2回答:2

如何将包从https://google.github.io/dagger/api/2.12/dagger/android/package-summary.html导入Android Studio Project?我尝试了一段时间,但没有得到它

java android kotlin dagger
2个回答
1
投票

//添加Dagger依赖项

dependencies {
  implementation 'com.google.dagger:dagger:2.x'
  annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
}

如果你在dagger.android中使用类,你还需要包括:

implementation 'com.google.dagger:dagger-android:2.x'
implementation 'com.google.dagger:dagger-android-support:2.x' // if you use the support libraries
annotationProcessor 'com.google.dagger:dagger-android-processor:2.x'

0
投票

添加您的gradle文件:

dependencies {
    implementation "com.google.dagger:dagger:2.13"
    kapt "com.google.dagger:dagger-compiler:2.13"
}
© www.soinside.com 2019 - 2024. All rights reserved.