0

I am trying to add this library to my project because I want to change something in a class there. That is why I adding it as a dependencies in my gradile setting is not enough.

I know that in the library it says "If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.". But what does that mean, should I copy all files and put them in my libs folder ?

Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126

1 Answers1

4

Quoting the documentation:

If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.

Step #1: Download the project, whether via the ZIP file that GitHub gives you or by using git to clone the repository

Step #2: Move the MaterialDesign/ directory into your project directory, as a peer of your existing app/ module

Step #3: Modify your settings.gradle in your project directory to include :MaterialDesign in the list of modules to build

Step #4: In your app module's build.gradle file, add compile project(':MaterialDesign') to your dependencies

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thank you for your quick comment. I did the first and second step, but now I don't know how to add the :MaterialDesign in my Gradile exactly. Is it the Gradile Module file or the Project one ? – Georgi Koemdzhiev Jun 19 '15 at 23:04
  • 1
    @GeorgiKoemdzhiev: `settings.gradle` is a text file. You can open it in Android Studio or your favorite text editor. Most likely, it will have a single line, `include ':app'`. Edit it to be `include ':app', ':MaterialDesign'`. Save the modified file. And you are done with Step #3. – CommonsWare Jun 19 '15 at 23:06
  • Did that. Now When I try to Sync gradle in Step 4 it says "Error:Configuration with name 'default' not found." This is how my dependencies look like : dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.github.navasmdc:MaterialDesign:1.5@aar' compile project(':MaterialDesign') compile 'com.nineoldandroids:library:2.4.+' } – Georgi Koemdzhiev Jun 19 '15 at 23:13
  • @GeorgiKoemdzhiev: One thing you need to do for certain is get rid of the `compile` line for the copy of that `MaterialDesign` library you are pulling in via the AAR. You cannot have two copies of the same library. Beyond that, perhaps there is something off in your directory structure and `settings.gradle`: http://stackoverflow.com/a/22547615/115145 – CommonsWare Jun 19 '15 at 23:29
  • I followed these steps @CommonsWare mentioned and getting the error Error:Project :app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :libs:recognito. I am trying to include the lib - https://github.com/amaurycrickx/recognito – ugola Jun 07 '17 at 06:41