# Overriding template variables for Gradle generation

I'm using Unity 2020 to build for Android. Unity provides a mainTemplate.gradle file, looks a bit like this.

As per Unity docs, there are certain template variables that Unity will fill in when it generates the actual build.gradle file.

What the docs don't mention at all is what the logic is behind how these are filled in. The specific issue I have is that it defaults to a version of the build tools that's too old for a particular entry in my manifest. As such, I'm trying to override BUILDTOOLS, but I've not been able to find anything online about either manually overriding an arbitrary template variable, or explicitly setting the Build Tools version.

All the docs say is SDK Build tools used (for example, 25.0.1)., completely unhelpfully.

• What version of the Android SDK do you have installed? Does the SDK have a build tools version setting? Jun 11 '21 at 11:52
• I had two versions of build tools, 28.0.3 which I didn't want, and 30.something. In the end it just needed a Unity restart to pick up the newer version. So I assume it just ends up choosing whatever's newer in the SDK that's bundled with it.
What I didn't realize is that I needed to restart Unity for that to happen. I also deleted Temp/gradleOut for good measure. So, between these two actions, it eventually started working.