简体   繁体   中英

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.

错误图片

How to solve this error?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM