View must have a tag error in android data binding

前端 未结 7 2303
清酒与你
清酒与你 2021-02-13 05:54

I\'ve two layouts for a screen. Activity works fine while setting a layout for Mobile device but it\'s causing error while setting layout for tablet device. The main issue is:

7条回答
  •  不思量自难忘°
    2021-02-13 06:26

    Keeping two layouts, one with layout tag of data-binding and another without it, is the common cause of this issue.

    I got stuck when I renamed my two normal layout files with same name (/layout and /layout-sw720dp) and used tag. Then, it worked for mobile device but not for tablet. So, after cleaning project, it all started working.

提交回复
热议问题