方式一:
將aar文件粘貼到modul的libs目錄中抱慌,然后再對應(yīng)的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
圖一
然后選擇對應(yīng)的文件點(diǎn)擊完成
圖二
之后在你的主Module中將該Module添加為依賴即可蜀铲。