3
votes

When i use ViewBinding, it always generate xxxxxBinding.

I know android use Android Gradle Plugin build apk with code and resources。

And they're going to split some task (or transform).

I know task(transform) will build some file into ./build .

But the ViewBinding makes me confused,He doesn't appear to be generating files(Because every time I create layout file, I can access it directly)(Or I can just delete the build folder and it won't be created again,But he can still get it right(No error) in the code)。

Were some files secretly generated?

If so, where will it be generated?

If not, how can I do the same? For example, use a markdown file to generate code in real time.

as you said xxxxxBinding will be created. There will be atleast 2 build folder for each android project. Did you delete the build folder in the root directory or inside app directory( here app is a module directory)?. For every build, xxxxxBinding will be generated - Raghul Vaikundam
There's new thing in Gradle called incremental processing & ViewBinding processes uses the same to generate files on the go. So whenever any layout file changes, it gets reflected to generate Binding class. - Jeel Vankhede
@VaikundamRaghul I delete the build folder inside app directory. /app/build/ @JeelVankhede So, where can i spot this Binding class? Are them in some file ? - user9214779
Generally Binding class can be found in app/build/generated/data_binding_base_class_source_out/debug/out/com/example/package/databinding. Here com/example/package refers to the package name com.example.package. Let me know if it is there - Raghul Vaikundam
@VaikundamRaghul I know there will generated Binding class, But when i delete that folder, I still can visit new layout's Binding class while there is no one build folder. - user9214779