Skip to content Skip to sidebar Skip to footer

Build Android Error At Stage App:mergedebugresources, Parseerror Attributensnotunique

I've been trying to build my Android Application on Android Studio 4.2 with Gradle 4.2.1, but I am faced with the following error of which I was only able to find one question one

Solution 1:

The answer to this question is that the error and the stacktrace are actually two different problems.

There was a problem with one of my xml layouts, yes, but the biggest issue was that the version of gradle 4.2.1 has obfuscated how to find the problem.

So if you want to actually know what is failing, downgrade your gradle to 4.1.3 and gradle will now tell you where your xml is wrong. I recommend this whatever error you have, be it a parse error, a resource error or a prolog error.

Now, for the actual exception, Android Studio does not detect when an attribute is duplicated between the <layout> tag and another different layout, like constraintLayout, frameLayout, etc... so if you are using databinding, check that any extra layouts you are using don't have the same attribute. In fact I just recommend moving any attributes to your second, implementation specific layout and leave the databinding tag alone.

Solution 2:

In my case, it was an issue with the layout tag. I was using layout_width and layout_height inside it because of which it was giving me the same error.

So anyone using data binding double check this and also check if you are using the same id's for different layouts.

Post a Comment for "Build Android Error At Stage App:mergedebugresources, Parseerror Attributensnotunique"