2022-06-29
2022-06-29 本文已影响0人
一骑绝尘Louisk
android studio将含有第三方jar包的lib库工程打成jar包
一、配置编译代码
如图:核心编译配置代码:
task makeJar(type:Jar){
archivesBaseName ="tcl_xmpp_1.8_629"//打包后的jar名
from(project.zipTree('build/intermediates/packaged-classes/release/classes.jar'))//添加classes
from(project.zipTree('build/intermediates/packaged-classes/release/libs/asmack.jar'))//添加三包
destinationDir = file('build/libs')
}
makeJar.dependsOn(build)
二、IDE右上角Gradle--mylibrary--other--双击makejar,即可。