Learning Android Development
Convert Android’s Gradle files from Groovy to Kotlin Step by Step
Transform your initial Android Project Gradle into Kotlin
Published in
5 min readSep 25, 2021
When we create a project in Android (Arctic Fox 2020.3.1), we get the default Gradle Script setup for us. There are 3 Gradle files, they are all written in Groovy still.
- The
settings.gradle
- The root project’s
build.gradle
- The app module’s
build.gradle
How nice if it is in Kotlin. Well, let’s convert them to Kotlin using the below step-by-step guide.
Gradle support interoperability of Groovy and Kotlin Gradle file. Hence we can convert them one at a time. Let’s convert them one by one.
Convert the settings.gradle
1. Rename to .kts file
First, just convert the file name from settings.gradle
to settings.gradle.kts
.
You can do so by selecting the settings.gradle
file, then go to Refactor →Rename File.