Kotlin buildSrc failing on Gradle 4.10 due to missing dependency

This is due to a breaking change in Kotlin DSL 1.0:

The kotlin-dsl plugin now requires a repository to be declared

With Kotlin 1.2.60, the Kotlin Gradle Plugin driving the kotlin compiler requires extra dependencies that aren't required by Gradle Kotlin DSL scripts alone and aren't embedded into Gradle.

This can be fixed by adding a repository that contains Kotlin compiler dependencies on the project where the kotlin-dsl plugin is applied: repositories { jcenter() }


build.gradle.kts should contain

plugins {
    `kotlin-dsl`
}
// Required since Gradle 4.10+.
repositories {
    jcenter()
}