Android Gradle merged Values.xml uses wrong namespace
Had the same issue. Mine was due to Crashlytics. Their automatically generated xml file has invalid name spaces.
Read all my answer first : it seems that this error is due to another compilation problem...
Initially, to deal with this error, I updated my code like this:
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
...
</resources>
into this code:
<resources ignore="MissingTranslation">
...
</resources>
And it works for me at the beginning...but I had another compilation error due tu gradle configuration...and now that these compilation errors are corrected, my previous update does not work anymore. I had to add the namespace to generate the APK file.
So , be sure to correct all the compilation errors first before to deal with this error...
I just spent around 2 hours digging through the Git commit that broke our Gradle build. This commit contained over 200 changed files with 4000+ modified lines. You can imagine how much fun it was ;)
Anyway, here is what caused this obscure Gradle error for us: Some styles with a xmlns:custom
attribute were defined in res/values/styles.xml
:
<style name="content" xmlns:custom="http://schemas.android.com/apk/res-auto">
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/content</item>
</style>
As you can see the custom
namespace is not even used. For some reason the Ant and ADT builds did not care about this attribute, but the Gradle :processDebugResources
task barfed with a not very helpful error message.
Removing xmlns:custom="http://schemas.android.com/apk/res-auto"
fixed it.
Versions used: Gradle 1.10 and 'com.android.tools.build:gradle:0.8.0'