Git Dependencies in Gradle

I found it a pain to get git dependencies working in Gradle, so I decided to write this ugly blog post for my future self and possibly some other desperately-searching Android developers.

The problem:

Including git project dependencies (e.g. a common library among your apps).

The solution:

Add this to your root build.gradle:


To your root settings.gradle:


To your app build.gradle:


And that is it!!

To update the library, you can just go to the root build/library/ and run a git pull.

Thanks goes to:

ajoberstar for suggesting the Grgit.clone method (

athor for explaining how to neatly include projects in settings.gradle (


Leave a Reply

Your email address will not be published. Required fields are marked *