Android Studio: How to link my .aar library to mul

2019-04-14 16:27发布

问题:

I have a library that I use in multiple projects. Every time I update (and rebuild) this library, I do not want to have to copy and paste the .aar to EVERY single project that uses this library. What is the most convenient, efficient way to accomplish this?

Note: I'm running Android Studio 1.0 RC2 on Mac OSX.

回答1:

Upload your android library as an artifact to maven central or jcenter. Checkout this guide that i totally find worth mentioning here to understand how to upload your android library to one of these central repository or both.

Once uploaded and synced , you can simply reference your library using

dependencies {
     compile 'com.your.groupid:artifactid:x.x.x'
}

and thats it.