Android Studio Export Jar Package

Source: Internet
Author: User

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

    1. the front apply plugin: ' Com.android.application '   apply plugin: ' com.android.library '
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.