Android的工作室:如何我.aar库链接到多个项目? [英] Android Studio: How to link my .aar library to multiple projects?
问题描述
我有我在多个项目中使用库。我每次更新(重建)这个库,我不希望有到.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工作室1.0 RC2
Note: I'm running Android Studio 1.0 RC2 on Mac OSX.
推荐答案
上传你的Android库作为神器行家中心或 jcenter 。
结帐<一个href=\"http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en\"相对=nofollow>这个指南,我完全找到值得一提这里了解如何将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的工作室:如何我.aar库链接到多个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!