Try to add a kotlin file: File -> New -> Kotlin File/Class
.
The following Configure Kotlin
shall be prompted.
The following shall be added to Project build.gradle
.
buildscript {
ext.kotlin_version = '1.3.31'
...
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Module build.gradle
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
...
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Reference: