AS中引用本地aar

生成aar之后下一步就是如何引用本地的aar文件?以test.aar文件为例
1、把aar文件放在一个文件目录内,比如就放在libs目录内

2、在app的build.gradle文件添加如下内容

repositories {

    flatDir {

        dirs ‘libs’ //this way we can find the .aar file in libs folder

    }

}
3、之后在其他项目中添加一句gradle依赖便方便的引用了该library

dependencies {

    compile(name:’test’, ext:’aar’)

}

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>