Search code examples
androidkotlinandroid-viewbinding

ViewBinding class not generated


I have enabled view binding in my build.gradle file:

android {
    ...
    viewBinding {
        enabled = true
    }
}

and I've split my layout folders to maintain an order because it is a big project. However, my ViewBinding class isn't being generated.

Picture of the error

How to solve this error?


Solution

  • As you mentioned, it is probably because you made subfolders in the layout folder which isn't something you are supposed to do

    However, there are plugins like this:

    Which allow you to have virtual folders.