Today, when compiling with Android Studio, we found an AAR package containing resource files and class files! A description of the AAR was then queried:
1.AAR description
Document address; Http://tools.android.com/tech-docs/new-build-system/aar-format
AAR formatthe ' AAR ' bundle is theBinary distribution ofAn Android Library project.thefileExtension is. AAR, and theMaven artifact type should be AAR asWell but the fileitself a simple zipfile with theFollowing entries:/androidmanifest.xml (mandatory)/classes.jar (mandatory)/res/(mandatory)/r.txt (mandatory)/ assets/(optional)/libs/*.jar (optional)/jni/<abi>/*.so (optional)/proguard.txt (optional)/lint.jar (optional ) These entries is directly at theRoot of theZipfile. The R.txtfile is theOutput ofAapt with --output-text-symbols. "
See this directory, is not the dream of resource file packaging it! Very excited, is there? Ha ha......
Through this query about AAR, found this site is still good, there are many instructions about the use of Android studio,
http://tools.android.com/tech-docs/new-build-system/
2,aar Packaging
1> to a module to be packaged into AAR, first this module should be a library, if it is a applicateion, there is no need to package into AAR directly generated apk, so first make sure that this module is a library!
2> on the command line into the module's folder (below is the file under My Library Module's folder):
/WyfCode/data$ ls
build.gradle data.iml libs proguard-rules.pro src
3> Direct Execution Command:
gradle build
4. After successful execution of the above command, the module folder will have one more folder: Build, as follows:
/WyfCode/data$ lsbuild build.gradle data.iml libs proguard-rules.pro src
The packaged AAR is under directory/build/outputs/aar/.
3. Quoting AAR
Transferred from: http://stackoverflow.com/questions/16682847/ How-to-manually-include-external-aar-package-using-new-gradle-android-build-syst
fileinfolderfile name is cards.aar )theninandwithfiles.repositories { flatDir { ‘libs‘ }}dependencies { compile(name:‘cards‘, ext:‘aar‘in build -> exploded-aar`
Android Studio Packaging Reference for AAR