Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding actual error out of data binding error

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.

like image 693
jatin rana Avatar asked Nov 17 '17 16:11

jatin rana


People also ask

Can I use view binding and data binding together?

View binding doesn't support layout variables or layout expressions, so it can't be used to declare dynamic UI content straight from XML layout files. View binding doesn't support two-way data binding.

What is data binding with example?

Data binding can also mean that if an outer representation of the data in an element changes, then the underlying data can be automatically updated to reflect the change. For example, if the user edits the value in a TextBox element, the underlying data value is automatically updated to reflect that change.

Which is the correct way to reference bound data in the XML layout?

Layout Binding expressions Expressions in the XML layout files are assigned to a value of the attribute properties using the “ @{} " syntax. We just need to use the basic syntax @{} in an assignment expression. Expressions can be used for many purposes depending on your requirement.


1 Answers

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'
        }
    }
}
like image 138
Uli Avatar answered Sep 27 '22 22:09

Uli