赞
踩
在 app 的build.gradle 中 dependencies 前面 添加 repositories
//作用是添加一个本地仓库,并把libs目录当做仓库地址
repositories {
flatDir {
dirs 'libs'
}
maven { url "http://maven.aliyun.com/nexus/content/repositories/releases" }
}
然后就可以在dependencies 中添加导入 aar 包
dependencies {
//...
implementation(name: 'aar-name', ext: 'aar')
//...
}
具体例子 如下:
//...
//ActionDialog
implementation(name: 'action_dialog_library', ext: 'aar')
//...
添加了aar包后,重新编译下
注意:如果有多个libs目录,比如在子模块 ttt 中也有libs 用 逗号隔开 如下:
repositories {
flatDir {
dirs 'libs', '../ttt/libs'
}
maven { url "http://maven.aliyun.com/nexus/content/repositories/releases" }
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。