Data Binding Android - Type parameter T has incompatible upper bounds : ViewDataBinding and MainActivity

If your gradle version is ok (1.5+) then you should try this:

  1. Go to your "some_layout.xml"
  2. Click right -> Refactor -> Rename (or SHIFT + F6)
  3. Rename your layout to "some_layout2.xml" for example
  4. Rename this file back to the original "some_layout.xml"

This might fix the problem. Let us know.


This solution worked for me "File -> Invalidate Caches / Restart" https://stackoverflow.com/a/32191257/2205809


There is a simple solution.

  1. click "File" on toolbar of android studio
  2. click "Invalidate Caches and Restart", then it works.

Hope this answer will help you.