Updated to Android Studio 3.0. Getting a "Kotlin not configured" error
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.
Related videos on Youtube
Ryan Lertola
Updated on July 09, 2022Comments
-
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:
I've also tried:
- Restarting
- Clean and Rebuild
- Invalidate caches/restart.
-
bearlysophisticated over 6 yearsTry a clean build from CLI, it worked for me: close Android Studio and run
./gradlew clean assembleDebug
then start Android Studio again. -
vortek about 5 years
File -> Sync Project with Gradle files
worked for me ...
-
Martin about 6 yearsA few lines of context to know where the line goes would have been nice.
-
Martin about 6 yearsA few lines of context to know where the line need to be replaced would have been nice.
-
johnml1135 almost 6 yearsThis was very helpful to see it all laid out.
-
AdamHurwitz over 5 yearsI 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 about 5 yearsThis answer is not specific to Mac. It also worked on my Windows machine.
-
garbus about 5 yearsThanks! Removing jre7 from dependency helped me to sync and finally build project with a new Kotlin version.
-
benchuk over 3 yearssaved my day! i had a bad csv plugin. once removed - everything was back to normal
-
Mixno almost 3 yearsThank you! Worked for me
-
Joey Dalu about 2 yearsThis worked, thanks!