1

I have a repository on Github, I would like to use my repository in Android Studio using: dependencies {compile 'com.google.code.gson: Gson: 2+'} for gradle. Does someone know how to do this?

gsamaras
  • 71,951
  • 46
  • 188
  • 305
rodrigosimoesrosa
  • 1,719
  • 1
  • 12
  • 16

3 Answers3

6

You could use JitPack.io to expose your repository as a Maven dependency. Then including it in Android Studio is easy with gradle:

compile 'com.github.YourUsername:RepoName:ReleaseVersion'

There are more instructions on the website.

Andrejs
  • 26,885
  • 12
  • 107
  • 96
1

I don't know if I really got the question...I understood that you want to compile some jar files that are not local to your project and are hosted in your repository. If it is the matter, I guess you should use a custom maven repository, not a Github one. If this is the problem I can give you more details on how to create a custom maven repo.

visd0m
  • 46
  • 4
  • Hello, I want to use my repository (which is an Android library) that are hosted on github, in another project, as when we import for an Android project Gson the library, for example dependencies {compile 'com.google.code.gson: Gson: 2 +'} – rodrigosimoesrosa Apr 09 '15 at 20:47