Gradle Tips and Tricks for Android | Ray Wenderlich

Learn some cool tricks for working with the Gradle build system, such as autocompletion, using build-time variables, and reducing build time!

This is a companion discussion topic for the original entry at

Thank you for nice tutorial.

The only mark:

This setting



make build error if using gradle 4.7+ with AS 3.1.4


It can be seen from the Google Documentation here that the supported version for gradle to be used for Android Plugin 3.1+ is 4.4+.

But as per another page in their own documentation, they also admit that if one uses gradle 4.6+ then they will experience some build errors.

The issue is supposed to be fixed in a future release of the Android Gradle plugin.

For now, the straightforward solution is to use gradle version below 4.6 i.e 4.4, 4.4.1, 4.5.

Let me know if it helps.


Can I pass values from the build.gradle.kts into the Dependecies.kt
Specifically I want to setup the buildDir directory in one place that projects to all projects (including the one in buildSrc)

Also you should add this to the kts file:
repositories {

@nisrulz Can you please help with this when you get a chance? Thank you - much appreciated! :]

You can now use Kotlin instead of Groovy to write Gradle scripts

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!