摇篮错误:"属​​性" rippleColor"已定义"在机器人工作室摇篮、机器人、定义、错误

2023-09-05 01:58:49 作者:不谈成绩我们还是好朋友

所以我想出来的材料设计支持库,当我加入的依赖,编译,我得到这个错误。 我看了看类似的问题,并试图解决它们,但它不会得到固定的,所以我希望你能帮助我。

下面是我的logcat:

C:\Users\Jan\AndroidStudioProjects\SwagCalculator3\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.0\res\values\values.xml 误差:(1)属性rippleColor已经被定义

和这里是我的build.gradle:

 应用插件:com.android.application

安卓{
compileSdkVersion 22
buildToolsVersion22.0.1

defaultConfig {
    的applicationIDcom.raptor.swagcalculator.swagcalculator
    的minSdkVersion 21
    targetSdkVersion 22

}
buildTypes {
    推出 {
        minifyEnabled假
        proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
    }
}
}

依赖{
编译文件树(导演:库,包括:['的* .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 用于至少两次。

我建议你检查过你的XML-S含色素或任何属性(比如 colors.xml 的,或任何其他尝试搜索了整个项目在IDE)。

检查是否提到 rippleColor 被多次使用。如果你拥有了它在你的项目,将其重命名!

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:\Users\Jan\AndroidStudioProjects\SwagCalculator3\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.0\res\values\values.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'
}

解决方案

It seems that in the projects you are using (your own application + the used libraries) the Attribute named rippleColor is used at least two times.

I'd suggest to check through your xml-s containing colors or any attributes (e.g colors.xml, or any other, try search for it in the whole project in your IDE).

Check whether the mentioned rippleColor is used multiple times. If you have it in your project, rename it!