0

I have imported two libraries in my Android Studio project through gradle. One is support library v7 which is a necessary component to handle action bar in my app for different platforms. Another is the one I intent to use for UI components called MaterialDesign.

Problem is that both libraries have defined an attribute in their values.xml called rippleColor and gradle identifies the conflict.

How can I tell gradle to exclude one definition and accept the other? Manifest Merging in android developers hub seem to do that over the entire xml file whereas my problem is only one specific attribute in that file. Is there any way that I can get around this problem?

P.S. my gradle dependencies are as follows:

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'org.xwalk:xwalk_core_library:15.44.384.13'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
  • check http://stackoverflow.com/questions/33534963/is-there-a-resolution-for-this-conflict-between-the-material-design-support-libr – piotrek1543 Jan 04 '16 at 11:18
  • are you sure you use both in the latest version? – piotrek1543 Jan 04 '16 at 11:18
  • @piotrek1543 The issue did not resolve the problem. The error arises from duplicate declarations: Attribute "rippleColor" has already been defined. Seems as if we have a duplicate declaration in our own xml files. Would different version not define rippleColor attribute? that must be the question I guess – Amin Soltani Jan 04 '16 at 12:29
  • Post your dependencies – Gabriele Mariotti Jan 04 '16 at 12:39
  • compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'org.xwalk:xwalk_core_library:15.44.384.13' compile 'com.github.navasmdc:MaterialDesign:1.5@aar' – Amin Soltani Jan 04 '16 at 12:40

1 Answers1

0

Write below code in your grade file. It might help:

dependencies {
    compile 'com.android.support:support-v4:22.2.1'
    compile 'com.google.code.gson:gson:2.2.2'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'

   compile fileTree(dir: 'libs', include: '*.jar')
    compile fileTree(include: ['*.jar'], dir: 'libs')
}
jyomin
  • 1,957
  • 2
  • 11
  • 27