方式一:
将aar文件粘贴到modul的libs目录中,然后再对应的modul的build.gradle文件中添加如下:
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile (name:'你添加的aar文件的名字', ext:'aar')
}
方式二:
在AndroidStudio中选择File-->New-->New Module
然后选择Import Jar/AAR Package-->Next

然后选择对应的文件点击完成

之后在你的主Module中将该Module添加为依赖即可。
网友评论