我的app以前编译成功,但是编译的时候突然报错:
Execution failed for task ':app:dataBindingGenBaseClassesDebug'.
> Configurations for item_list.xml must agree on the root element's ID.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
我有 item_list 和 item_list(landscape) 的两种布局,并且没有修改任何这些文件。我使用安卓 4.2。
最佳答案
如果您有两个布局,那么您已经更改了它们,因为您没有使用框架的默认值。错误消息意味着,这两个版本的相同布局在其根节点上有两个不同的 ID。要解决这个问题,只需在两个根节点上使用相同的 ID。
关于Android:配置 .xml 必须同意根元素的 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65864197/