In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the "Android Stduio3.0 how to use gradle to package module jar file" related knowledge, editor through the actual case to show you the process of operation, the method of operation is simple and fast, practical, I hope that this "how to use gradle in Android Stduio3.0 to package module jar file" article can help you solve the problem.
AndroidStduio3.0 uses gradle to package module into jar files. First, you need to install gradle.
Open the console and enter the open-e. Bash _ profile command to open the text of the configuration file and add
And then save it. Save your settings by entering the source .bash _ profile command.
Enter the gradle-version command in the console to determine whether your installation of gradle is successful or not
When this is returned, the installation of gradle can be judged to be successful.
After gradle is successfully installed, add android {} in the gradle file of the module module.
LintOptions {checkReleaseBuilds false abortOnError false}
To make sure there are no mistakes when packing. To mainly add testCompile dependencies in dependencies
Dependencies {testCompile 'junit:junit:4.12'}
Finally, add the following code to generate the jar file
Task makeJar (type: Copy) {delete 'build/intermediates/task.jar' from (' build/intermediates/intermediate-jars/debug') / / after modifying here, you can export .jar into ('build/intermediates/') / / output location include (' classes.jar') / / imported rack package classes file rename ('classes.jar','task.jar') / / modify the name dependsOn build}
Then execute the gradle makeJar command in terminal, run the script, and execute the script successfully.
It should be noted that you need to find the files generated by jar in the build of the module module. By default, the files generated by jar are generated as shown in the following figure, but it is actually related to the AndroidStudio version, and the path needs to be modified according to the actual situation.
This is the end of the introduction on "how to use gradle to package module jar files in Android Stduio3.0". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.