An attribute already defined with an incompatible format (the original attribute is defined here)

Unable to create project after adding

compile 'com.android.support:design:24.2.0'

Saves the following errors:

The problem seems to be supporting vector drawings. Somewhere several attributes are added twice.

For example, the embedded values.xml file contains:

<declare-styleable name="AppBarLayout_LayoutParams"><attr name="layout_scrollFlags"><flag name="scroll" value="0x1"/><flag name="exitUntilCollapsed" value="0x2"/><flag name="enterAlways" value="0x4"/><flag name="enterAlwaysCollapsed" value="0x8"/></attr><attr format="reference" name="layout_scrollInterpolator"/></declare-styleable>

and

<declare-styleable name="AppBarLayout_Layout"><attr name="layout_scrollFlags">
        <flag name="scroll" value="0x1"/>
        <flag name="exitUntilCollapsed" value="0x2"/>
        <flag name="enterAlways" value="0x4"/> 
        <flag name="enterAlwaysCollapsed" value="0x8"/>
        <flag name="snap" value="0x10"/>

I added this to the gradle file:

compile 'com.android.support:cardview-v7:24.2.0' + '@aar'
compile 'com.android.support:recyclerview-v7:24.2.0' + '@aar'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
+4
source share
3 answers

The problem occurs when different versions of the same library are present in the application. In this case, different versions of the support library.

gradle, , , . , :

./gradlew app:dependencies

, appcompat /, .

+2

, ,

<declare-styleable name="MyBgView">
        <attr name="textString" format="string" />
        <attr name="textSizes" format="dimension" />
        <attr name="triangleSize" format="dimension" />
        <attr name="backgrounds" format="color" />
        <attr name="textColors" format="color" />

0

Android sdk .

<declare-styleable name="AppBarLayout_Layout" parent="AppBarLayout_LayoutParams">
    <attr name="layout_scrollFlags">
</declare-styleable>
0

Source: https://habr.com/ru/post/1653780/


All Articles