Android 升级后,Gradle不再显示dagger2组件图

Android 升级后,Gradle不再显示dagger2组件图,android,gradle,android-gradle-plugin,dagger-2,gradle-plugin,Android,Gradle,Android Gradle Plugin,Dagger 2,Gradle Plugin,最近,我将Gradle版本和Gradle插件更新为: 4.6和3.1.1。现在,当我试图编译有一些依赖性问题的项目时,gradle只指出一个编译错误,说它找不到类DaggerApplicationComponent 以前,当存在匕首依赖性问题时,它会显示哪些依赖性不满足,以及依赖关系树。比如: "Dagger 2 cannot be provided without an @Provides-annotated method" "Error:(51, 10) error: .BaseActiv

最近,我将Gradle版本和Gradle插件更新为: 4.6和3.1.1。现在,当我试图编译有一些依赖性问题的项目时,gradle只指出一个编译错误,说它找不到类DaggerApplicationComponent

以前,当存在匕首依赖性问题时,它会显示哪些依赖性不满足,以及依赖关系树。比如:

"Dagger 2 cannot be provided without an @Provides-annotated method"

"Error:(51, 10) error: .BaseActivity cannot be provided without an @Provides-annotated method. BaseActivity is injected at AppComponent.inject(baseActivity) Error:(75, 10) error: MainActivity cannot be provided without an @Inject constructor or from an @Provides-annotated method. MainActivity is injected at .AppComponent.inject(mainActivity)"
现在它显示:

不满足的依赖项来自java库中的一个类。其梯度文件为:

apply plugin: 'java-library'
apply plugin: 'net.ltgt.apt'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.dagger:dagger:2.15'

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


    api 'com.squareup.retrofit2:retrofit:2.4.0'

    api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'


    implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
    implementation 'com.squareup.okhttp:logging-interceptor:2.6.0'

    implementation 'io.reactivex.rxjava2:rxjava:2.1.12'


    api 'com.squareup.moshi:moshi:1.5.0'
    /*implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.google.code.gson:gson:2.8.2'*/



}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
// Top-level build file whesugre you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.google.gms:google-services:3.1.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }



}



plugins {
    id "net.ltgt.apt" version "0.15"

}

allprojects {


    repositories {
        jcenter()

        maven { url 'https://maven.google.com' }
        google()
    }



}


task clean(type: Delete) {
    delete rootProject.buildDir
}


Android Studio 3.1.1
Build #AI-173.4697961, built on April 3, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.14.0-deepin2-amd64
根梯度文件是:

apply plugin: 'java-library'
apply plugin: 'net.ltgt.apt'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.dagger:dagger:2.15'

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


    api 'com.squareup.retrofit2:retrofit:2.4.0'

    api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'


    implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
    implementation 'com.squareup.okhttp:logging-interceptor:2.6.0'

    implementation 'io.reactivex.rxjava2:rxjava:2.1.12'


    api 'com.squareup.moshi:moshi:1.5.0'
    /*implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.google.code.gson:gson:2.8.2'*/



}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
// Top-level build file whesugre you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.google.gms:google-services:3.1.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }



}



plugins {
    id "net.ltgt.apt" version "0.15"

}

allprojects {


    repositories {
        jcenter()

        maven { url 'https://maven.google.com' }
        google()
    }



}


task clean(type: Delete) {
    delete rootProject.buildDir
}


Android Studio 3.1.1
Build #AI-173.4697961, built on April 3, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.14.0-deepin2-amd64
是否需要其他配置

编辑:

现在,我通过命令行运行构建来解决这个问题

/格拉德卢建筑

它表明:

home/alexandre/dev/projetos/gitlab/BeerCollection/app/src/main/java/com/github/alexpfx/udacity/beercollection/dagger/ApplicationComponent.java:22: error: [com.github.alexpfx.udacity.beercollection.dagger.HomeSubComponent.inject(com.github.alexpfx.udacity.beercollection.ui.home.HomeFragment)] com.github.alexpfx.udacity.beercollection.databaselib.search.BeerRemoteDataSource cannot be provided without an @Provides-annotated method.
public interface ApplicationComponent {
       ^
      com.github.alexpfx.udacity.beercollection.databaselib.search.BeerRemoteDataSource is injected at
          com.github.alexpfx.udacity.beercollection.favorite.FavoriteInteractorImpl.<init>(…, beerRemoteDataSource)
      com.github.alexpfx.udacity.beercollection.favorite.FavoriteInteractorImpl is injected at
          com.github.alexpfx.udacity.beercollection.dagger.FavoriteModule.providesFavoriteInteractor(favoriteInteractor)
      com.github.alexpfx.udacity.beercollection.favorite.FavoriteInteractor is injected at
          com.github.alexpfx.udacity.beercollection.databaselib.search.DefaultSearchPresenter.<init>(…, arg2)
      com.github.alexpfx.udacity.beercollection.databaselib.search.DefaultSearchPresenter is injected at
          com.github.alexpfx.udacity.beercollection.dagger.SearchModule.searchPresenter(searchPresenter)
      com.github.alexpfx.udacity.beercollection.databaselib.search.SearchPresenter is injected at
          com.github.alexpfx.udacity.beercollection.ui.home.HomeFragment.searchPresenter
      com.github.alexpfx.udacity.beercollection.ui.home.HomeFragment is injected at
          com.github.alexpfx.udacity.beercollection.dagger.HomeSubComponent.inject(homeFragment)
2 errors

我无法让它显示在“构建”选项卡上,但对我来说没关系,单击“构建”选项卡上的“切换视图”可以找到渐变输出


单击“生成”选项卡上的“切换视图”可以找到渐变输出


IIRC应该有一些名为Logs或类似的选项卡,在那里可以找到完整的gradle输出。输出还将包括任何错误。有一个事件日志选项卡,但它没有显示依赖关系图。应该有一些称为日志或类似的选项卡,可以在其中找到完整的渐变输出。输出还将包括任何错误。有一个事件日志选项卡,但它不显示依赖关系图