My android project is written 100% in Kotlin and I wanted to rename the java directory to kotlin to be consistent. I added
sourceSets{ main.java.srcDirs +=
This works fine in Android Studio 3.6.2 and should be the most versatile solution until AndroidSourceSet starts supporting Kotlin directly. Just add the following snippet at the end of your app/build.gradle[.kts]:
3.6.2
AndroidSourceSet
app/build.gradle[.kts]
android.sourceSets.all { java.srcDir("src/$name/kotlin") }