ViewBinding class not generated

Viewed 2591

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?

2 Answers

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.

I encountered the same issue. I had to update my android studio to a version 3.6 or greater. It will resolve the issue.

Related