Member-only story
Publishing your first Android library to MavenCentral

Recently, I got myself engaged in a new world of Android development: publishing an open source Android library.
I can say that the struggle of publishing the library was real after realizing that I spent more time publishing the library than writing the entire library itself! 🤦♂️
After getting help from a lot of blogposts online and a lot of trial and error, I finally was able to publish it (I credit Márton Braun whose blogpost was a huge help for me).
I learnt that not only was it a lot of hard manual work to publish a library, but there wasn’t a single source of simple instructions to follow.
And I don’t blame the writers for the reason but rather that there are multiple ways to publish an Android library (I chose the hard one) and those ways keep on updating on regular basis.
Now that I’ve learnt enough, I’ll take my first published library as an example and make this a single source of guidance and all of you interested in publishing Android libraries.
So without further ado.. let’s get started!
Prerequisite ☝️
For this tutorial I’ve used Android Studio 4.1 but I believe that the instructions I give would be similar to older AS versions or other similar IDEs as well.
Project Setup ⚙️
To get things started, here’s what you do:
- Open a new project.
- Select an Empty Activity Project Template. This would create an empty Android project.


Creating the library 📚
- Click on File > New > New Module.
- Select Android Library.