MaterialDesignLibrary icon indicating copy to clipboard operation
MaterialDesignLibrary copied to clipboard

Cannot use with android support design library

Open ngvietan92 opened this issue 9 years ago • 20 comments

When I try used this library with android support design library, an error is appeared "Error:(1) Attribute "rippleColor" has already been defined" This is dependencies in my build.gradle file dependencies { ... compile 'com.android.support:design:22.2.1' compile 'com.github.navasmdc:MaterialDesign:1.5@aar' ... }

Please help me

ngvietan92 avatar Aug 02 '15 08:08 ngvietan92

i also faced the same problem.

vishnuchd avatar Aug 03 '15 10:08 vishnuchd

Same problem...

susheel17 avatar Aug 04 '15 06:08 susheel17

you hava compile 'com.android.support:design:22.2.1' ?

never615 avatar Aug 04 '15 10:08 never615

does not work with 22.2.1 either

rorlig avatar Aug 04 '15 20:08 rorlig

same

kamilwlf avatar Aug 05 '15 07:08 kamilwlf

what error do you folks get? can y'all open Gradle > build > (hit) build. and post the error that you get here?

Perhaps there's a library clash between the two and you may need to explicitly tell Gradle to exclude modules between the two.

stephenotalora avatar Aug 05 '15 12:08 stephenotalora

"Error:(1) Attribute "rippleColor" has already been defined"

I resolved it by importing the library directly into my project and changing the attribute name. I believe that is the quickest fix

rorlig avatar Aug 05 '15 12:08 rorlig

@rorlig how did you import the library? just Forked the repo and did you clone it into your project directory? then compile project in Gradle? do you have an example?

stephenotalora avatar Aug 05 '15 12:08 stephenotalora

@rorlig

dependencies {
compile(':MaterialDesingLibrary:') 
}

stephenotalora avatar Aug 05 '15 13:08 stephenotalora

yes i clones the repo and included the library in my project and then include in build.gradle as you mentioned.. dependencies { compile(':MaterialDesingLibrary:') }

rorlig avatar Aug 05 '15 13:08 rorlig

awesome! thanks for confirming @rorlig :)

stephenotalora avatar Aug 05 '15 13:08 stephenotalora

Same problem, i had to stop using this lib cause i need com.android.support:design:22.2.1.

Informatheus avatar Aug 18 '15 17:08 Informatheus

I had to use it below way after I import the library as module. dependencies { compile project(':MaterialDesign') }

munimisu avatar Sep 11 '15 03:09 munimisu

No need to import Material Design Library as library. I have forked the current version in here: https://github.com/vajro/MaterialDesignLibrary. I have modified the attribute "rippleColor" to "mRippleColor"

Hope it helps few people.

niwinnm avatar Oct 10 '15 09:10 niwinnm

Hello, i got the same error then i followied above link and put the gradle line as shown below

dependencies { compile fileTree(dir: 'libs', include: ['.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' // compile 'com.github.navasmdc:MaterialDesign:1.5@aar' compile 'com.github.vajro:MaterialDesignLibrary:1.6' / updated version to solve ripple error*/ compile 'com.android.support:design:23.3.0' }

Then getting error Error:(26, 13) Failed to resolve: com.github.vajro:MaterialDesignLibrary:1.6 Show in File
Show in Project Structure dialog

crashfiredeep avatar Apr 21 '16 05:04 crashfiredeep

@niwinnm thank you very much ,it's working I was in this issue more than 4 hours searching for what's the problem , I'm very happy :)

saraelmoghazy avatar Apr 27 '16 09:04 saraelmoghazy

@crashfiredeep - It's been working for me without issues. Did you import the maven repo for Jitpack inside your repositories? Like this: repositories { maven { url "https://jitpack.io" } }

niwinnm avatar Apr 27 '16 09:04 niwinnm

@niwinnm there has a error: Attribute application@label value=(@string/app_my_name) from AndroidManifest.xml:78:9-44 is also present at [com.github.vajro:MaterialDesignLibrary:1.6] AndroidManifest.xml:13:9-41 value=(@string/app_name). Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:74:5-579:19 to override.

uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [com.github.vajro:MaterialDesignLibrary:1.6]

*****build\intermediates\exploded-aar\com.github.vajro\MaterialDesignLibrary\1.6\AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.gc.materialdesign" to force usage

github201407 avatar Jun 22 '16 02:06 github201407

@github201407 Well, we usually use 16 as our min SDK version at our company as it covers more than 95% of the Android devices. You could clone the our repo and edit it, if you really need 14 as minSdkVersion.

Regarding the other error: this should help you out: http://stackoverflow.com/questions/25981156/tools-replace-not-replacing-in-android-manifest

niwinnm avatar Jun 22 '16 05:06 niwinnm