Skip to content Skip to sidebar Skip to footer

Dagger 2 On Android, Missing Error Messages

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) but it's al

Solution 1:

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.

Post a Comment for "Dagger 2 On Android, Missing Error Messages"