Dagger 2 on Android, missing error messages

前端 未结 1 1049
攒了一身酷
攒了一身酷 2021-01-17 12:15

I\'m using Dagger 2 in my Android project and I\'m having trouble debugging it. I know that the compilation fails because of an error in my dagger 2 setup (had it before) bu

相关标签:
1条回答
  • 2021-01-17 12:55

    Java

    javac by default will only show up to 100 errors. You are probably over this limit because of databinding reporting an error for each binding class it generates.

    Add this to your apps's build.gradle:

    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "500"
        }
    }
    

    Kotlin

    You can enable the same javac option when using kapt by adding the following to your build.gradle.

    kapt {
        javacOptions {
            option("-Xmaxerrs", 500)
        }
    }
    

    This is currently ignored, but will be fixed in Kotlin v1.2.20.

    0 讨论(0)
提交回复
热议问题