Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Followed tutorial but can't get MainActivityBinding class generated for ViewBinding

Following the exact documentation but can’t figure out why it’s not working…
https://developer.android.com/topic/libraries/view-binding

enter image description here

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

enter image description here

enter image description here

The class is never generated for my MainActivity
activity_main.xml

enter image description here

I’ve tried cleaning the project, rebuilding it. Even invalidating cache + restart, but have no idea why it’s still not working…

>Solution :

You added tools:viewBindingIgnore="true" into the layout, so the binding class for the layout is not created.

Delete tools:viewBindingIgnore="true" and try again.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading