Checklist for bringing old projects up-to-date

Introduction:

Nikitha Gullapalli
3 min readNov 26, 2020

Android studio usually greats us with a message as shown in fig below to update when there is an update available. clicking on it will update gradle to the latest version.

gradle update available

It is always a good idea to be aware on how to do it manual Ashwell. In This article we’ll see how to update the project to make it up-to-date.

Bringing old projects up-to-date usually consists of the below three steps.

  1. Update gradle android plugin : Gradle plugin is what allows gradle to understand and execute android build. As well as facilitating the synchronization between gradle and android studio’s project model.
  2. Update the gradle wrapper : Scripts and jar that allows gradle to install itself on what ever system we are building on and makes sure anyone build our project is using the same version of gradle.
  3. Update sdk, build tools, libraries: This allows us to use the latest and greatest features of gradle.

1. Update gradle android plugin

To use plugins we need to use gradle dependency management system for the dependencies of the build script itself. So lets open build.gradle script file and update classpath dependency to the latest version and try again to build.

2. Update the gradle wrapper

First- make sure gradle local version is up-to-date. We can do so by typing below command in the terminal. This will give the local version of gradle. Check the latest version online and confirm that's the version you have locally, else download the latest version and install it.

gradle  --version

Second- go back to the terminal and type the below command. This task will re create the wrapper including any updates to the shell scripts or wrapper jar.

gradle  --wrapper

Third- open gradle-wrapper.properties script file. This file figures how the gradle wrapper will function and also what version of gradle the wrapper will use by specifying the distribution URL. make sure the distribution url is pointing towards the latest gradle-version-all.zip. Sync project.

3. Update sdk, build tools, libraries:

Open app build.gradle and update all the dependencies to the latest version. Update the CompileSdkVersion to up-to-date. Make sure buildToolsVersion is also up-to-date.

We can find the latest buildToolsVersion at sdkManager->SDK Tools-> click showPakage details box-> under Android SDK build-tools find the latest version.

Additional Libraries and useful links:

https://bitbucket.org/hvisser/android-apt

https://libgdx.badlogicgames.com/

References:

--

--