android studio3.4 jar packaging

The first step in the document build.gradle android {} which was added the following content

    //生成jar包
    task makeJar(type:Copy) {
        delete 'build/outputs/network.jar'
        from('build/intermediates/packaged-classes/release/') //jar文件来源
        into('build/libs/') //生成路径
        include('classes.jar')
        rename('classes.jar','network.jar') //命名为network.jar
    }
    makeJar.dependsOn(build)

Then click on the top right corner of gradle, select: app is the name of the current project, and then open the other waiting to see makeJar then double-click.

Guess you like

Origin www.cnblogs.com/c-x-a/p/11599654.html