Recently to help a friend to do an app, which used a lot of third-party module, so that the project is very large, very redundant, and then want to turn it into a jar to refer to. Jar is familiar to us, full name is java Archive and AAR full name is Android Archive as the name implies AAR for Android use library file that specific how to use it
A piece
An AAR is available in the compiled output file in the module of the project
The AAR file is then tested into the Libs file and then introduced into the Gradle file. Still very simple, by the way to remember a few gradle in the configuration (many online, want to learn Google a bit. )
- Complie Filetree (dir: ' xxx ', include:[' *.jar '): relies on all files in a directory that match the extension.
- Complie ' com.xx.xx:ProjectName:version ': Configuring the Maven library as a dependency
- Complie Project (': Anothermodule '): Configure another module to be dependent on the module, and the dependent module must be imported into the current project
- Complie files (' Xxx.jar '): Configures a jar package as a dependency.
Configurations for using AAR and Gradle in Android studio