Android Studio: How to link my .aar library to multiple projects?

蹲街弑〆低调 提交于 2019-12-12 09:09:18

问题


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.



来源:https://stackoverflow.com/questions/27218299/android-studio-how-to-link-my-aar-library-to-multiple-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!