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?
Asked
Active
Viewed 1,231 times
3 Answers
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
-
Do you know if this works with BitBucket? And if we can use a private repository? @Andrejs – David Cesar Santos May 04 '15 at 13:47
-
@DavidCesarSantos Private GitHub repos, yes. For BitBucket: https://github.com/jitpack/jitpack.io/issues/25 – Andrejs May 04 '15 at 16:23
-
I will wait for the BitBucket features. Thanks! – David Cesar Santos May 05 '15 at 07:39
-
hey, I test JitPack with GitHub and is not easy to use. I have all the time an error. Do you have a sample? The samples of the web site isn't clear – David Cesar Santos May 05 '15 at 13:25
-
@DavidCesarSantos why dont you open a github issue with the error? there's also a chat for discussing issues – Andrejs May 05 '15 at 13:51
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