我的应用程序曾经编译成功,但在编译时突然出现错误消息:
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(横向)的布局,并且没有修改其中任何一个文件。我使用的是Android 4.2。
发布于 2021-01-23 20:52:09
如果您有两个布局,那么您已经更改了它们,因为您没有使用框架的默认布局。该错误消息意味着,同一布局的这两个版本在其根节点上有两个不同的ID。要解决这个问题,只需在两个根节点上使用相同的ID即可。
发布于 2021-10-05 01:25:30
什么时候你会用相同的名字做一个以上的布局。
然后给出两者具有相同的根Id。
例如。
activity_main.xml(normal xml){ <LinearLayout
android:id="@+id/ll_main/">
}
activity_main.xml(large xml) { <LinearLayout
android:id="@+id/ll_main/">
}
完成了☻♥。
https://stackoverflow.com/questions/65864197
复制