This blog will show you how to export the jar package with Android studio, hoping to bring you help.
First you need to modify file, in android Studio file, if you want to export the entire project to jar package, find the corresponding item in the catalogue of the file to modify it. There are several places that you need to modify
- the front apply plugin: ' Com.android.application '   apply plugin: ' com.android.library '
- defaultconfig
Defaultconfig {
Minsdkversion 14
Targetsdkversion 23
}
The SDK version can be changed according to your own version.
3. at the end, add
Task Deleteoldjar (type:delete) {
Delete ' Build/outputs/test.jar '
}
task Exportjar (type:copy) {
from build/intermediates/bundles/release/' )
into build/ libs/' )
include ' Classes.jar ' )
rename Classes.jar ' ' Test.jar ' }
Exportjar.dependson (Deleteoldjar, build)
where is the path to be everywhere, this can be customized, Rename in the Test.jar It's going to be everywhere. Jar The name of the package is also customized.
This is a visual operation after the changes are complete.
First Punch Gradle
Open App->tasks->other->exportjar
and then double-click Exportjar you can do it.
Note: If you are exporting for the first time, it may take a long time because Android Studio need to download some files, Then it will be soon.
A successful run will show
Android Studio Export Jar Package