DataBinding Guide States
By default, a Binding class will be generated based on the name of the layout
file, converting it to Pascal case and suffixing “Bindi
Faced the same issue.
Reason for "cannot resolve ActivityMainBinding" is that your Binding file isn't generated. Try to clean and rebuild project. Also make sure you have followed the steps :
Alternatively if you want to see the generated source.
These classes will be generated on first build. Also make sure the applicationId in your application module is same as the package name in AndroidManifest.xml of your app module. Hope this helps.