I am using data binding without any problems and it works good. But sometimes it frustrate me a lot by hiding the real problem by showing data binding error for no reason. Last time i made some changes in room database and mistakenly used wrong table name in ROOM DAO. At the time of building project android studio displayed multiple data binding error for no reason but not the real culprit ( wrong table name ). When i fixed that build worked. Now again i have made some changes and its giving me same data binding error, i am going through each file to find the real culprit but didn't see anything problematic. Any help to show all the error not just data binding error. This is very annoying Android Studio gradle build did not display all error at the bottom.
Asked
Active
Viewed 3,299 times
14
2 Answers
15
The Java compiler cuts off errors after 100 by default. With a standard Android-style project structure, add this to your root level build.gradle
to raise the limit (to 500 in this case) - this raises the limit for all subprojects. You will still have to dig through all errors to find the real ones:
subprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xmaxerrs' << '500'
}
}
}

Uli
- 2,828
- 20
- 23
-
Yes , i am getting 101 errors all of related to data binding. Thanks i will use it, at least i will have an idea. Right now i am, shooting in the dark. – jatin rana Nov 17 '17 at 16:28
-
Thanks man, solved. Real culprit Error:(23, 20) error: Cannot find getter for field. Error:(26, 21) error: Cannot find getter for field. in one of room model class and all i was getting 100 error related to data binding. Using your solution i got 150 error at compile time and cornered the right issue. Wasted a lot of time yesterday on this. Thanks a ton. – jatin rana Nov 17 '17 at 16:40
-
3This is not changing the number of errors that I get – n.arrow001 Sep 03 '18 at 07:35
-
I have the same problem. I added this block of code to my root gradle file but it doesn't work. – Tom Wayne Oct 15 '18 at 11:03
-
1Man, I wasted so many time and read so many articles to find an actual error, but only your solution helped me. Thank you so much!!! – AloDev Nov 16 '18 at 06:47