I just updated to Android Studio 3.0 and I\'m getting this error with an existing project:
Kotlin not configured
When I go to
Closing and restarting Android Studio works for me in that case. Important is that there are no other projects opened in Android Studio before you close it. I suspect that closing Android Studio with multiple opened project windows sometimes messes up the configuration especially after plugin upgrades etc.
The only fix for me was adding
apply plugin: 'kotlin-android-extensions'
in build.gradle (:app)
In my case I had to update Android studio from version 3.4.1. to 3.5 and it resolved the kotlin not configured error.
Simply Create a new Activity and select its language to kotlin Android studio Automatically configured kotlin for you.
Kotlin gradle config page has detailed information about this.
Check kotlin version in project level gradle file.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
For
kotlin_version '1.2.x'
Usejdk
NOTjre
Check JDK version in File > Project Structure
Or check in build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
If no JDK version is set in Project Structure, then choose by Android Studio version
Because Android Studio is bundled with jdk 1.8 since 2.2.1 version.
You have 3 options of kotlin stdlib, choose according JDK version
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" //jdk_version == 1.8
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" //jdk_version == 1.7
implementation"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" // jdk_version is < 1.7
if
kotlin version is'1.1.x'
Use jre NOT jdk
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" // or jre8
You can update Kotlin version from Tools > Kotlin > Configure Kotlin Updates
The only thing that worked for me was to uninstall the kotlin plugin (File -> Settings -> Plugins -> Kotlin press uninstall) and after a restart of Android Studio reinstall the plugin.