问题描述
我有一个在多个项目中使用的库.每次我更新(和重建)这个库时,我都不想将 .aar 复制并粘贴到每个使用这个库的项目中.实现此目的最方便、最有效的方法是什么?
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?
注意:我在 Mac OSX 上运行 Android Studio 1.0 RC2.
Note: I'm running Android Studio 1.0 RC2 on Mac OSX.
推荐答案
将您的 android 库作为工件上传到 maven central 或 jcenter.结帐本指南我在这里完全觉得值得一提,以了解如何将您的 android 库上传到这些中央存储库之一或两者.
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'
}
就是这样.
这篇关于Android Studio:如何将我的 .aar 库链接到多个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!