Gradle 错误:“属性"rippleColor"已经定义"在安卓工作室 [英] Gradle error: "Attribute "rippleColor" has already been defined" in android studio

查看:40
本文介绍了Gradle 错误:“属性"rippleColor"已经定义"在安卓工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我尝试了材料设计支持库,当我添加依赖项时,编译,我得到了这个错误.我查看了类似的问题并尝试了他们的解决方案,但没有得到解决,所以我希望你能帮助我.

这是我的日志:

C:UsersJanAndroidStudioProjectsSwagCalculator3appuildintermediatesexploded-aarcom.android.supportappcompat-v722.2.0
esvaluesvalues.xml错误:(1) 属性rippleColor"已经定义

这是我的 build.gradle:

应用插件:'com.android.application'安卓 {compileSdkVersion 22构建工具版本22.0.1"默认配置{applicationId "com.raptor.swagcalculator.swagcalculator"minSdk 版本 21目标SDK版本22}构建类型{发布 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译文件树(目录:'libs',包括:['*.jar'])编译'com.android.support:design:22.2.0'编译'com.android.support:appcompat-v7:22.2.0'编译'com.android.support:support-v4:22.2.0'编译'com.android.support:cardview-v7:22.2.0'}

解决方案

我有同样的问题,经过长时间的搜索我发现有些库使用相同的属性 rippleColor

<块引用>

示例:

1- 谷歌播放服务

编译'com.google.android.gms:play-services:7.8.0'

2- 设计支持库

编译'com.android.support:design:22.2.0'

3- 材料设计

编译'com.github.navasmdc:MaterialDesign:1.5@aar'

<块引用>

解决这个问题

首先解决此问题,将 google play 服务 包(整个包)替换为您需要的特定包,请查看 google site 就像在 Google Wallet 中一样,有一个名为 rippleColor 的属性,在我的情况下,我只需要 google maps com.google.android.gms:play-services-maps:7.8.0

第二您可以将设计支持库compile com.github.navasmdc:MaterialDesign:1.5@aar 替换为compile 'it.neokree:MaterialNavigationDrawer:1.3.2' ,如果你只需要使用导航抽屉

希望对你有帮助

So I was trying out the material design support library and when I added the dependency, compiled, and I got this error. I looked at similar problems and tried their solutions but it would not get fixed so I hope you can help me.

Here's my logcat:

C:UsersJanAndroidStudioProjectsSwagCalculator3appuildintermediatesexploded-aarcom.android.supportappcompat-v722.2.0
esvaluesvalues.xml
Error:(1) Attribute "rippleColor" has already been defined

and here is my build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.raptor.swagcalculator.swagcalculator"
    minSdkVersion 21
    targetSdkVersion 22

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
}

解决方案

I have same issue , after long search I found there are some libraries use the same attribute rippleColor

Example:

1- Google play service

compile 'com.google.android.gms:play-services:7.8.0'

2- Design Support Library

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

3- MaterialDesign

compile 'com.github.navasmdc:MaterialDesign:1.5@aar'

Fix this issue

First to fix this issue replace google play service package (whole package) with specific one you need , please review google site as in Google Wallet there attribute called rippleColor , in my case all I need google maps com.google.android.gms:play-services-maps:7.8.0

Second you can replace Design Support Library compile com.github.navasmdc:MaterialDesign:1.5@aar with compile 'it.neokree:MaterialNavigationDrawer:1.3.2' , if you need to use navigation drawer only

I hope this help

这篇关于Gradle 错误:“属性"rippleColor"已经定义"在安卓工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆