1

I am trying to use MaterialDesignSupport lib and MaterialDesignLib (gitHub) in the same project

Gradle Dependcies:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
    compile 'com.android.support:design:22.2.0'
    compile files('MaterialDesign/libs/nineoldandroids-2.4.0.jar') //that jar was missing from some reason
}

but i get Error:(1) Attribute "rippleColor" has already been defined. according to this answer the attr rippleColor is mentioned multiple times in the project and i should rename it but the file that contains the attr is under built folder and it regenerates every time so i can't rename it. Is there a way to rename built files or any way to solve this?

Community
  • 1
  • 1
ben
  • 1,064
  • 3
  • 15
  • 29

2 Answers2

0

You have 2 different definitions of rippleColor in your app, so you'll not be able to compile it because the definitions are built probably in different libraries that you've used.

The only way I see to solve it is copying the code that you need from one of the libraries and avoid copying the rippleColor definition.

arodriguezdonaire
  • 5,396
  • 1
  • 26
  • 50
0

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

with compile 'com.github.vajro:MaterialDesignLibrary:1.6'

and add

repositories {
    maven { url "https://jitpack.io" }
}

Note: The aforementioned github repo is a forked version of https://github.com/navasmdc/MaterialDesignLibrary in which the rippleColor attribute has been renamed as mRippleColor

Or clone the original repo to desktop (or somewhere) and edit the attribute and use it.

Saravanabalagi Ramachandran
  • 8,551
  • 11
  • 53
  • 102