Android Gradle merged Values.xml uses wrong namespace

前端 未结 6 2051
野性不改
野性不改 2020-12-14 11:59

In the process of converting a project to the Android build system I get this error whenever I attempt to compile.

Gradle: Error parsing XML: prefix must not b

6条回答
  •  心在旅途
    2020-12-14 12:19

    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:

    
    

    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'

提交回复
热议问题