android data binding: how to get useful error messages -


in android studio 2.1, compile time error messages xml mistakes entirely non-helpful:

error:(11, 41) error: package mypackage.databinding not exist error:(15, 13) error: cannot find symbol class myactivitybinding 

the real error "there's no such attribute android:adapter", or "variable foo doesn't contain property bar" or that. instead of showing such errors, shows above unhelpful ones, tell bindings weren't generated because of unknown error.

there's no easy way now. in general, if face such compilation error , error messages point @ missing databinding classes either bad reference layout (i.e. try access members classes assigned not expose - happens when c&p layouts).

even worse, when use other code generating libraries (icepick, butterknife, etc) real culprit can in code unrelated binding. when occur in code, check gradle console view , read end up, ignoring error messages related databinding "missing class" or "package not exists"


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -