android studio將含有第三方j(luò)ar包的lib庫工程打成jar包
一、配置編譯代碼
如圖:核心編譯配置代碼:
task makeJar(type:Jar){
? ? archivesBaseName ="tcl_xmpp_1.8_629"http://打包后的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药版,即可揩悄。