Error adding appcompat-v7 api level 22

0

I'm trying to add appcompat-v7 to my project, but when I sync with gradle the following error occurs:

/path/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values/values.xml
Error:(2) Attribute "layout" has already been defined

Here is my build.gradle where I just added the line compile 'com.android.support:appcompat-v7:22.2.1'

    compileSdkVersion 22
    buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
}
...
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:22.2.1'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services-analytics:7.3.0'
    compile('org.simpleframework:simple-xml:2.7.1') {
        exclude group: 'stax', module: 'stax-api'
        exclude group: 'xpp3', module: 'xpp3'
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.5.1@aar') {
        transitive = true;
    }
}
    
asked by anonymous 30.09.2015 / 18:52

2 answers

0

The problem is really that described in the error, I found in the file res/values/attr.xml the second code snippet

<declare-styleable name="CustomListView">
    <attr name="layout" format="integer"/>
</declare-styleable>

I commented this code and Bingo!

    
02.10.2015 / 19:36
0

I have not tested your configuration, but the problem can be buildToolsVersion "22.0.1" . Move to the version you are working 22.2.1

I also suggest that you use the new version, 23. I had some problems with appCompat in this version that you are trying to use. Good luck

  compileSdkVersion 23
  buildToolsVersion "23.0.0"

  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.android.support:support-annotations:23.0.0'
  compile 'com.android.support:design:23.0.0'
  compile 'com.android.support:recyclerview-v7:23.0.0'
  compile 'com.android.support:cardview-v7:23.0.0'
    
02.10.2015 / 15:03