Android studio generates the AAR package and references the AAR package in other projects

1. AAR package is the AAR file generated after SRC, res and Lib in Android project are packaged in Android studio. After AAR package is imported into other Android studio projects, other projects can easily reference source code and resource files

2. Steps to generate AAR package:

① Open a project with Android studio, and then create a new module. When creating a new module, select Android library, and then click create common project

② . the new module type is Android library, as shown in the following figure

③ After coding in the new module, the AAR package will be generated automatically after compiling the whole project. The path of the package is in the new module = = "build = = =" outputs = = > AAR directory. As shown in the figure

3. Other Android studio projects refer to AAR package

① . copy the AAR package to the Lib directory

② . configure the build.gradle file:

join

Complete profile:

③ . compile a project

Copy AAR package to Lib as shown in the figure

After the figure is copied to lib, click the button below to make the AAR package referenced in the code or compile the project once

After the above operations are successful, you can see the referenced AAR package file under the extension package

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>