Sign in Go Pro

Gradle Dependency Management: Using Kotlin and buildSrc for build.gradle Autocomplete in Android Studio



Did you know you can write Kotlin in a module named buildSrc to manage your dependencies in your Gradle files?

How? When you run Gradle, it checks for the existence of a directory called buildSrc. Gradle then automatically compiles this code and puts it in the classpath of your build script. You don’t need to provide any further instruction.

It may not seem like it’s that big of a deal, but managing Gradle dependencies is a pain, and getting to use Kotlin and having autocomplete in Android Studios is a game changer.