Troubleshooting

There are a few errors that you may encounter if your setup is not correct. Here are the frequent errors and the appropriate solutions:

No resource type specified

Error:(42, 42) No resource type specified (at ‘attribute’ with value '@{“image”}’).

Either you forgot to enable the DataBinding Library or your itemLayout does not start with a <layout> root tag.

NoClassDefFoundError

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/databinding/DataBinderMapper; at android.databinding.DataBindingUtil.(DataBindingUtil.java:31)

You forgot to enable the DataBinding Library.

Only one layout element

Error:Only one layout element and one data element are allowed. /path/to/your/app/build/intermediates/res/merged/debug/layout/hits_item.xml has 2

Your <layout> should have only one child: put all current children in a single <ViewGroup>.