【发布时间】:2015-12-28 14:03:44
【问题描述】:
我正在尝试将 appcompat-v7 添加到我的项目中,但是当我运行 gradle sync 时会引发以下错误:
/path/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values/values.xml 错误:(2) 属性“layout”已经定义
那是我的 build.gradle,我只需在其中添加行 compile 'com.android.support:appcompat-v7:22.2.1'
/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
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;
}
}
【问题讨论】:
标签: android android-studio android-appcompat