本文介绍了找不到com.google.dagger:dagger-compiler:3.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从Eclipse导入了项目,并且遇到了很多错误,并且在成功构建之后最终解决了所有这些错误,我得到了错误:

I have imported project from Eclipse and I got so many errors and I resolved all of them now in the end after successful build, I'm getting error:

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)中的代码是

and code in build.gradle(module:app) is

    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'
            }
        }
    }
}

重建后,项目已成功构建,但未创建APK并给出错误;

After rebuild, project is built successfully but it is not creating APK and giving error;

推荐答案

现在Dagger的最新版本为 2.15 ,请更改此行:

Right now the latest version of Dagger is 2.15, change this line:

annotationProcessor 'com.google.dagger:dagger-compiler:2.15'

其他Dagger库也包括:

Also other Dagger libraries are:

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"

这篇关于找不到com.google.dagger:dagger-compiler:3.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 08:45