hrat hrat
hrat hrat

Reputation: 1

update gradle 3.2 get Android resource compilation failed. and get warn: ignoring element 'g' with unknown namespace

When I update gradle and build my project I get the error below:

Android resource compilation failed
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:484: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:608: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:608: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:630: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:647: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:667: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:706: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:714: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:714: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/apk/res-auto'.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:732: warn: ignoring element 'g' with unknown namespace 'http://schemas.android.com/tools'.


D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:2143: error: invalid resource type 'attr' for parent of style.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:2636: error: duplicate value for resource 'attr/layout_anchorGravity' with config ''.
D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:2636: error: resource previously defined here.

There was no error with gradle 2.1.4

Upvotes: 0

Views: 1477

Answers (1)

Izabela Orlowska
Izabela Orlowska

Reputation: 7532

There are two problems here

First, look through the files under your app/src/main/res/values. One of them defines a style, and uses an attribute as the parent for that style:

D:\MyAndroidApp\MyApp2\MyApp\build\intermediates\incremental\mergeWithAnalyticsDebugResources\merged.dir\values\values.xml:2143: error: invalid resource type 'attr' for parent of style.

Style's parents can only be styles. Either remove that parent completely or change it to another style.

Secondly, there seem to be two conflicting definitions of an attribute layout_anchorGravity - either in your dependencies or in your local values files. Check where this attribute is coming from and either override it or remove it completely.

Upvotes: 1

Related Questions