@peng90 The most common causes of the binding object not being created are:
-
Not having the dataBinding reference in your app Gradle file
-
Not having the enclosing layout in the view
-
There is another problem somewhere in the project and the build is never getting to the stage where it generates the binding objects
Since “dataBinding { enabled = true }
” is in the beginning sample project app level build.gradle we can safely rule that out. The next step would be to see if the project compiles successfully without a reference to that binding class (by commenting out any references to it in RageComicDetailsFragment.kt). If it doesn’t then you probably have syntax error somewhere else in your project. If it does build and run successfully this is probably a issue with the fragment_rage_comic_details.xml layout. Check that and see if you have all of the text from the tutorial copied and also make sure that something crazy didn’t get introduced during that process. You could copy the layout from the final project over to the one in your in process project that you are working through as a sanity check. If that doesn’t work another option could be to clear the Invalidate Caches/Restart option under the File menu. Hopefully one of those options will get you past that issue. If not please let me know and we will dig further.