'Android: Configurations .xml must agree on the root element's ID
My app used to compile successfully, but it suddenly produces an error message when compiling:
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.
I have two layouts for item_list and item_list(landscape) and did not modify any of these files. I use Android 4.2.
Solution 1:[1]
If you have two layouts, you already have changed them, as you are not using the framework's default. The error message means, that these two versions of the same layout have two different IDs on their root node. To fix that, just use an identical ID on both of the root nodes.
Solution 2:[2]
When ever you'll made more than one layout with same name.
Then give both have Same Root Id.
ex.
activity_main.xml(normal xml){ <LinearLayout
android:id="@+id/ll_main/">
}
activity_main.xml(large xml) { <LinearLayout
android:id="@+id/ll_main/">
}
Done??.
Solution 3:[3]
Just add a LinearLayout each an every layout file i.e Landscape, portrait. No need to declare Id on root element.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Martin Zeitler |
| Solution 2 | Mohamed Abulnasr |
| Solution 3 | Tarique Anowar |
