How to Create an Android Archive (AAR) Library

Everything you should know about AAR.

Siva Ganesh Kantamani
9 min readFeb 16, 2020

Index

  1. The necessity of the Android library
  2. Why Android Archive (AAR)?
  3. Create a library module
  4. Dependencies in AAR file
  5. Implement your logic in your Library Module
  6. Gradle Rules you should be aware
  7. How to generate AAR file
  8. Real-time problems with solutions
  9. How to integrate AAR library
  10. Useful links

1. The necessity of the Android library

Android library is structurally the same as an Android app with resource files, source code, manifest file, and so on. However, instead of compiling into an APK, an Android library compiles into an Android Archive (AAR) file that you can use as a dependency so that we don’t need to create or write the same code all the time.

If you’re an android developer for a while, you should’ve at-least used one library (maybe support libraries 😉). If you see GitHub, it has many open source libraries for the date picker, Image Loading, and so on. The core intention of all these…

--

--