Updated to Android Studio 3.0. Getting a "Kotlin not configured" error

42,542

Solution 1

I first tried with invalidate cache/ restart option but it doesn't help me.

When I updated Kotlin to 1.1.60 in project's gradle file, problem is solved.

Also, use this in app's gradle for stdlib

implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.60" 

instead of

implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"

Solution 2

In Android Studio, click on File -> Invalidate Caches / Restart... , then select "Invalidated and Restart". This solved my problem.

Solution 3

This error also occurs if you have the mavenCentral() repository missing in allprojects. Your build.gradle (:app) should contain at least this:

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

jcenter() would work as well (for now), but that repository reached end-of-life and shouldn't be used any more.

Solution 4

Kotlin-stdlib-jre7 is deprecated since 1.2.0 and should be replaced with kotlin-stdlib-jdk7

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 

Solution 5

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.

Share:
42,542

Related videos on Youtube

Ryan Lertola
Author by

Ryan Lertola

Updated on July 09, 2022

Comments

  • Ryan Lertola
    Ryan Lertola almost 2 years

    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 Tools>Kotlin>Configure Kotlin in Project, I get an error saying "no configurators available". Also get the error below with the red java:

    enter image description here

    I've also tried:

    • Restarting
    • Clean and Rebuild
    • Invalidate caches/restart.
    • bearlysophisticated
      bearlysophisticated over 6 years
      Try a clean build from CLI, it worked for me: close Android Studio and run ./gradlew clean assembleDebug then start Android Studio again.
    • vortek
      vortek about 5 years
      File -> Sync Project with Gradle files worked for me ...
  • Martin
    Martin about 6 years
    A few lines of context to know where the line goes would have been nice.
  • Martin
    Martin about 6 years
    A few lines of context to know where the line need to be replaced would have been nice.
  • johnml1135
    johnml1135 almost 6 years
    This was very helpful to see it all laid out.
  • AdamHurwitz
    AdamHurwitz over 5 years
    I tried this which I thought resolved the issue. However, when I reverted to my original implementation implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" the error was still resolved. I must of just needed to have the gradle file re0run.
  • Zun
    Zun about 5 years
    This answer is not specific to Mac. It also worked on my Windows machine.
  • garbus
    garbus about 5 years
    Thanks! Removing jre7 from dependency helped me to sync and finally build project with a new Kotlin version.
  • benchuk
    benchuk over 3 years
    saved my day! i had a bad csv plugin. once removed - everything was back to normal
  • Mixno
    Mixno almost 3 years
    Thank you! Worked for me
  • Joey Dalu
    Joey Dalu about 2 years
    This worked, thanks!

Related