Android appcompat 库 + 设计库 = 构建错误
Android appcompat lib + design lib = build error
这是我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "xxx"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:cardview-v7:22.0.+'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:design:22.2.0'
}
添加这个库后
compile 'com.android.support:design:22.2.0'
我无法构建应用程序,因为出现以下错误:
/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values/values.xml
Error:(2) Attribute "rippleColor" has already been defined
这个库可以一起使用吗?
谢谢!
路易斯
p.s。我需要(现在)FloatingActionButton (fab) 的设计库。
看起来属性 rippleColor 被使用了不止一次(依赖项和您自己的应用程序)。
检查您的 xml 文件中是否有名称为 "rippleColor" 的属性,看看它是否被多次使用。如果可以,请将其重命名为其他名称。
如果项目中有 attr 文件,请删除此行:
<attr name="rippleColor" format="color" />
这是我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "xxx"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:cardview-v7:22.0.+'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:design:22.2.0'
}
添加这个库后
compile 'com.android.support:design:22.2.0'
我无法构建应用程序,因为出现以下错误:
/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values/values.xml
Error:(2) Attribute "rippleColor" has already been defined
这个库可以一起使用吗?
谢谢! 路易斯
p.s。我需要(现在)FloatingActionButton (fab) 的设计库。
看起来属性 rippleColor 被使用了不止一次(依赖项和您自己的应用程序)。
检查您的 xml 文件中是否有名称为 "rippleColor" 的属性,看看它是否被多次使用。如果可以,请将其重命名为其他名称。
如果项目中有 attr 文件,请删除此行:
<attr name="rippleColor" format="color" />