0

I am new to android. I wish to use https://github.com/mikepenz/MaterialDrawer navigation drawer project's library. It is provided with a dependency.

The MaterialDrawer Library is pushed to Maven Central, so you just need to add the following dependency to your build.gradle.

compile('com.mikepenz:materialdrawer:3.1.2@aar') {
        transitive = true
    }

There are 2 files in Gradle Scripts folder of my android studio project

  1. build.gradle (Module :app)

  2. build.gradle (Project : AndroidAppName)

In which folder , i should enter these dependency code ? Could you please explain the procedure of compilation/build of an android studio project.

Thanks in advance

mikepenz
  • 12,708
  • 14
  • 77
  • 117
Rahul Saxena
  • 422
  • 1
  • 9
  • 22

4 Answers4

2

The website says:

The MaterialDrawer Library is pushed to Maven Central, so you just need to add the following dependency to your build.gradle.

compile('com.mikepenz:materialdrawer:3.1.2@aar') {
    transitive = true
}

So, all what you have to do is open your build.gradle file inside app folder and the following line inside here:

dependencies {
   // compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
}
narancs
  • 5,234
  • 4
  • 41
  • 60
0

you have to put it inside your project. inside the app module.

Edit: For more explanation the android documentation is pretty good: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Tasks

0

In Android studio you have projects with alot of modules. The gradle build system is setup in the same way. First entry point is the build.gradle in your project folder. Here you can define global configurations, like third party repositories etc. Normaly you dont have to change anything here. Then every modul has a build.gradle which is included when compiling into the projects build.gradle. A modules build.gradle file defines configuration and dependencies for the module and beneeth.

In your case means that, that you have to add the dependency part you got into the build.gradle file in the app module, because you need it in the app ;)

Rene M.
  • 2,660
  • 15
  • 24
0

Module :app

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:design:22.2.0'
    compile('com.mikepenz:materialdrawer:3.1.2@aar') {
        transitive = true
    }
}
EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428