java.lang.NoClassDefFoundError: android.databinding.DataBinderMapper
at android.databinding.DataBindingUtil.(DataBindingUtil.java:31)
a
I was having this issue this last week, and was having a hard time figuring it out, but finally I discovered that I had two layouts with the same name in different libraries that each use databinding. I'm guessing this was causing the generated binding classes to end up in some kind of bad state at runtime.
I was able to troubleshoot it into a situation where, instead of getting this error on one Fragment, I got a ClassCastException to happen on the Fragment that had a layout with the same name. The generated Binding class was trying to cast a LinearLayout into a RelativeLayout. The only way it could be doing this is if it were trying to use a layout file from a completely different module that had the same name.
After making sure there were no layouts that share the same name -- even across different library modules -- it cleared up.