在 Android Studio 3.0 Canary 4 中设置 dagger 2.x 时出现以下错误
错误:(71, 20) 无法解析:com.google.dagger:dagger:2.x
错误:(73, 20) 无法解决:com.google.dagger:dagger-android:2.x
错误:(74, 20) 无法解决:com.google.dagger:dagger-android-support:2.x
我的构建文件如下所示:
dependencies {
//For DI - Dagger 2
implementation 'com.google.dagger:dagger:2.x'
annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
implementation 'com.google.dagger:dagger-android:2.x' // If you're using classes in dagger.android
implementation 'com.google.dagger:dagger-android-support:2.x' // if you use the support libraries
annotationProcessor 'com.google.dagger:dagger-android-processor:2.x'
}
项目构建文件有以下片段
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
感谢您的帮助...