打出aar包
編寫自己的library項(xiàng)目(mememe)戒财,編寫完成之后症见,開始生成aar工具包喂走,操作如下:
點(diǎn)擊右側(cè)Gradle,打開你剛建的library項(xiàng)目下的列表谋作,打開Task——>other找到bundleReleaseAar雙擊之芋肠,就開始生成你的aar了。
如果在gradle菜單欄中沒有出現(xiàn)如上各個task遵蚜,則這樣去操作:
取消這個Only include test tasks... 勾選:
然后帖池,aar包出現(xiàn)在該模塊的build->outputs->aar路徑下:
引用aar包:
在某個module或app模塊引用該aar,將該aar拷貝到該模塊的libs目錄下:
引用libs下的aar包:
dependencies {
implementation(fileTree("libs"))
}