首先新建一个工程名为ActivityLibrary
然后引入一个modoul,取名为mylibrary
打开my library的build写入
task makeJar(type: Copy) {
delete 'build/libs/mysdk.jar'
from('build/intermediates/bundles/release/')
into('build/libs/')
include('classes.jar')
rename ('classes.jar', 'mysdk.jar')
}
makeJar.dependsOn(build)
然后在terminal下生成,输入
./gradlew make Jar
然后取出jar包即可