Where to get AAR file of any library?

At my current project at work, I have a situation to add a third-party library locally instead of fetching it from jCenter or JitPack.io. So, my first task is to download AAR or JAR file of the library. The reason of using AAR/JAR is to avoid compiling of library on each build of the project to decrease build time.

Here’s how

First, you need to include it in your project using traditional way of implementation as you do with Android Studio. Once its compiled, then go to the directory:

Here, you can see 1 or more directories with long key hashe names. Each directory will contain either ```AAR``` or ```JAR``` or ```POM``` file. Copy the ```AAR``` file and paste it in your ```app```'s ```libs``` directory. Ant then add this line in your app level ```build.gradle``` file.

implementation ('libs/LIBRARY_AAR_FILE_NAME_WITH_EXTENSION') {
        transitive true

If you liked this article, you can read my new articles below:

Wajahat Karim is Pakistan’s first Google Developer Expert in Android. As an experience Android developer, he deeply cares about it and keeps writing and speaking about it. He has written two worldwide 300+ pages books on Android development with more than 100 articles around the internet either on his website or his Medium publications. He is also a passionate contributor in open source and has created many Android libraries used by thousands of developers in their apps worldwide. As active public speaker, he spends lots of time giving talks in conferences and motivating people on Android development. You can find Wajahat most active on Twitter @WajahatKarim where he regularly shares all the good stuff about Android and community building.

Author's picture

Wajahat Karim

🔥 Google Dev Expert (GDE) in Android .
📱 Android Dev. 💻 Open Source Contributor . 📝 Technical Writer . 🎤 Public Speaker

Senior Android Developer

Karachi, Pakistan