1

I forked a project and I made a little modification on https://github.com/oursgris/datetimepicker

How can I make it available in android studio ?

I tryied to add in build.gradle :

dependencies {
   compile 'com.github.oursgris.datetimepicker:library:0.0.3'
}

I had an error : Failed to resolve: com.github.oursgris.datetimepicker:library:0.0.3

What did I missed ?

I manage to output aar file but I don't know how to make it available in android studio with a simple dependancy (like other projects)

Regards

P. Sohm
  • 2,842
  • 2
  • 44
  • 77
  • possible duplicate of [How to build an android library with Android Studio and gradle?](http://stackoverflow.com/questions/16718026/how-to-build-an-android-library-with-android-studio-and-gradle) – Kuba Spatny Mar 14 '15 at 18:31
  • now it isn't. The project is well compiled but I'd like to use it as a dependancy in my project – P. Sohm Mar 14 '15 at 19:06
  • Sorry you're right, I picked the wrong link. The problem why it can't find it is because it's not in the central repository. You can either create a local repository, which you can add to the central repository in the gradle build file or you can upload your library to maven central repository as described here: http://stackoverflow.com/questions/28383415/publish-an-aar-file-to-maven-central-with-gradle-not-working – Kuba Spatny Mar 14 '15 at 20:53
  • you probably don't want to make your edit available on maven/jcenter. it makes more sense for you to make a pull request and have your change merged back into the repo – dabluck May 02 '15 at 21:23

1 Answers1

2

You almost got it right. What was missing is that you need to add a repository that stores your 'aar' file. You can do this with JitPack:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

And then add your library as:

dependencies {
    compile 'com.github.oursgris:datetimepicker:0.0.3'
}
Andrejs
  • 26,885
  • 12
  • 107
  • 96