Kotlin gradle plugin 1.2.51

I had the same issue and I solved it by changing the plugin version in the dependencies section of the buildscript in the build.gradle file :

buildscript {
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51"
    }
}