Androidstudio 3 Export Jar file

Source: Internet
Author: User

1. Named Modulea in the Android Library example, File, new, new Module

2. Modify the build.gradle that you just created Modulea

Add Publishnondefault True under Android entry (otherwise there will be no compiled jar folders and files under the build folder)

3. If you have other dependent jar files, place them inside the Modulea Lib folder and add the link path under Dependance

Dependencies {Implementation Filetree (include: ['*.jar'], dir:'Libs') Testimplementation'junit:junit:4.12'Implementation'COM.ANDROID.SUPPORT:APPCOMPAT-V7:28.0.0-ALPHA3'androidtestimplementation'com.android.support.test:runner:1.0.2'androidtestimplementation'com.android.support.test.espresso:espresso-core:3.0.2' Implementation files ('libs/xxx-classes.jar' )}

4. Add the following code

task Clearjar (type:delete) {Delete'Build/libs/xyz.jar'////This line means that if you have already made a bag and then pack it, delete the original package .}task Makejar (type:copy) { from('build/intermediates/intermediate-jars/release/')//this line represents the path of the file to be packaged, according to the following content, which is actually the path under the Classes.jarInto'build/libs/')//This line indicates the package's build path after packaging, that is, the resulting package existsInclude'Classes.jar')//See this line, if you know anything about subcontracting, you can see that it's just packing some classes.Rename ('Classes.jar','Xyz.jar')}makejar.dependson (Clearjar, build)

Note: The folder name in the Pink box may vary depending on the as version

5. Locate the Makejar under this folder, double-click, and compile it to find the compiled Xyz.jar in the build/libs/directory under Modulea

6 If you want this file to be used in Unity3d, just throw it into the Unity3d assets/plugins directory

Reference: Https://stackoverflow.com/questions/43039532/no-release-bundle-folder-after-upgrading-android-studio

53406390

Androidstudio 3 Export Jar file

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.