Some problems that occur when using ViewBinding in Android

AndroidStudio app:dataBindingGenBaseClassesDebug, Found data binding error(s):

[databinding] {"msg":"Button id@id/button conflicts with another tag that has the same ID","file":"res\\layout\\activity_test.xml","pos":[{"line0":89,"col0":4,"line1":100,"col1":35}]

When I was developing the project today, the project used ViewBinding. I modified the ID and deleted the layout of some layout files, and then this error was reported. I have been unable to solve it. I searched online and found that it was used in Andoird. If you enter gradlew assembleDebug in Studio , there will be no problem, but there will be no problem running.

        But this problem occurred again when packaging the APK, and another error was reported! ! ! ! !

Note: Finally, I used a method to solve it

Find the user folder of the computer --> delete the --> caches folder in .gradle

If you try to delete it, it will prompt that there is a file running in the current folder, then restart the computer and delete it again. After the deletion is successful, re-enter Anadroid Studio and it will rush through the project. After the rebuild is completed, you can successfully run the package.

Hope it helps! ! ! !

Guess you like

Origin blog.csdn.net/m0_62278064/article/details/130838588