Error adding appcompat-v7 api level 22

Asked

Viewed 266 times

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

Follow my build.Radle 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;
    }
}

2 answers

0


The problem is really the one described in the error, 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 on this code and Bingo!

0

I haven’t tested your configuration, but the problem could be buildToolsVersion "22.0.1". Go to the version you are working on 22.2.1

I also suggest that you use the new version, the 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'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.