找不到 com.google.dagger:dagger-compiler:3.0.0
Posted
技术标签:
【中文标题】找不到 com.google.dagger:dagger-compiler:3.0.0【英文标题】:Could not find com.google.dagger:dagger-compiler:3.0.0 【发布时间】:2018-10-11 10:34:40 【问题描述】:我从 Eclipse 导入了项目,我遇到了很多错误,我现在在成功构建后最终解决了所有问题,我收到了错误:
build.gradle(project)
中的代码是
buildscript
repositories
jcenter()
maven
url 'https://maven.google.com/'
name 'Google'
google()
dependencies
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.0'
allprojects
repositories
jcenter()
maven
url 'https://maven.google.com/'
name 'Google'
build.gradle(module:app) 中的代码是
android
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig
applicationId "com.thanu.schoolbustracker"
minSdkVersion 24
targetSdkVersion 27
buildTypes
release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
dependencies
annotationProcessor 'com.google.dagger:dagger-compiler:3.0.0'
compile 'com.android.support:support-v4:27.0.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile files('libs/google-play-services.jar')
compile files('libs/maps.jar')
compile 'com.android.support:support-annotations:27.0.2'
compile 'com.android.support:support-v13:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:gridlayout-v7:27.0.2'
compile 'com.android.support:mediarouter-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:palette-v7:27.0.2'
compile 'com.android.support:leanback-v17:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:exifinterface:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.1.0'
compile 'com.android.support.test:runner:1.0.1'
compile 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.android.support.test.espresso:espresso-contrib:3.0.2'
compile 'com.android.databinding:library:3.1.2'
compile 'com.android.databinding:baseLibrary:3.1.2'
compile 'com.android.databinding:compiler:3.1.2'
compile 'com.android.databinding:adapters:3.1.2'
compile 'com.google.android.gms:play-services-ads:15.0.0'
compile 'com.google.android.gms:play-services-wearable:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'com.google.android.support:wearable:2.3.0'
configurations.all
resolutionStrategy.eachDependency DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support')
if (!requested.name.startsWith("multidex"))
details.useVersion '25.3.0'
rebuild后,项目构建成功,但没有创建APK并报错;
【问题讨论】:
【参考方案1】:目前 Dagger 的最新版本是 2.15,更改此行:
annotationProcessor 'com.google.dagger:dagger-compiler:2.15'
其他 Dagger 库还有:
compile "com.google.dagger:dagger:2.15"
compile "com.google.dagger:dagger-android:2.15"
compile "com.google.dagger:dagger-android-support:2.15"
annotationProcessor "com.google.dagger:dagger-android-processor:2.15"
【讨论】:
我得到的这个错误是什么配置“编译”已过时,已被“实施”和“API”取代。它将在 2018 年底被删除。有关更多信息,请参阅:d.android.com/r/tools/update-dependency-configurations.html 这不是错误,而是警告。最近(由于 android studio 3 和新的 gradle wrapper)compile 被替换为 implementation。 这是错误我得到 org.gradle.api.UncheckedIOException: Failed to capture input files of task ':app:javaPreCompileDebug' property 'annotationProcessorConfiguration' during up-to-date check。跨度> @AdeepMalmotra 我相信这是一个与匕首本身无关的不同错误?我建议编辑更改错误的问题或为此创建一个新问题。 好的..感谢您的支持,很快将更新新问题。以上是关于找不到 com.google.dagger:dagger-compiler:3.0.0的主要内容,如果未能解决你的问题,请参考以下文章