Error: Type mismatch. Required: ActivityMainBinding. Found: ViewDataBinding! //Android Kotlin Dev Diary

Written by

on

in

,

The problem is that this line of code is producing an error:

        binding = DataBindingUtil.setContentView(this, R.layout.activity_main)

And the error says:

Type mismatch.
Required:
ActivityMainBinding
Found:
ViewDataBinding!

The solution is to add a <layout> tag in the layout file that you are inflating!

Related Posts

About the author:

Catzie Avatar

The homo sapiens behind these blog posts is “Catzie“

Explore my top blog posts:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *