how to create a jar file from android studio

前端 未结 5 1182

I have a fairly latest version of android studio, I have created a module under a project which is basically supposed to be a library, when I build it, it creates an \".aar\

5条回答
  •  情歌与酒
    2021-01-04 20:43

    I found a way to achieve this, plain simple, using Gradle 2.2.1:

    task jar(type: Jar, dependsOn: 'assembleRelease') {
        from fileTree(dir: 'build/intermediates/classes/release')
    }
    

    Place this in your library module. It will compile it as release and produce a JAR file in: build/libs.

    bash gradlew jar or use your IDE to target that jar Gradle task.

提交回复
热议问题