ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Follow publication

Member-only story

Better Dependency Management Using

Dependency management for better reusability and easy maintenance

Satya Pavan Kantamani
ProAndroidDev
Published in
5 min readJun 22, 2021

Introduction

Since the start of using Android Studio, Gradle has become a central place for managing many things like dependencies, config data, flavours, etc. And maintaining the dependencies across multi-module projects has become a challenge over time. Let’s see in detail how the evolution of dependencies management across multi-module projects happened and the problems faced. Please check out my previous post on Kotlin DSL for a better understanding

The core part of this post is how we can achieve better dependencies management using

Problem

If you want to skip the evolution process move to the usage of with Kotlin DSL section else continue reading.

Let’s take a multi-module app to understand the problem. Manually declaring versions along with dependencies across multi modules is our first approach. That would look something like below

At first module build.gradle file we declare dependencies

In the second module build.gradle fiile we declare same dependencies

As we are defining dependency versions at each build.gradle file this has created problems like conflicting versions if not upgraded correctly. It’s very hard to manage the version upgrades of dependencies and config data. Whenever there is a change in dependency if we have more modules there was a lot of manual process of going to each and every module and checking whether the dependency is exiting or not if found updating and then moving to next.

Configure project-wide properties

Then we moved to set project-wide properties using Gradle Extra properties. For this approach, we used to define the config data and dependency versions at the project or…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Written by Satya Pavan Kantamani

Android Dev, Interested in Traveling, App development. Based in Hyderabad, India. Catch me at https://about.me/satyapavankumar

Responses (7)

Write a response