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
Though I see that the question already has answers that work, one might also try the following solution.
Right click on the file name (Main.kt) -> Run 'Main.kt'.
This will download a gradle file from the gradle.org website.
Wait for it to unzip. The errors were cleared.
just delete .idea folder from project,and run android studio again, it will resolve KOTLIN NOT CONFIGURED issue.
One other point to check is version of your Gradle in gradle-wrapper.properties
, if you use one.
Make sure that
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Has version 4.1 or higher.
You may also have the following in your build.gradle
:
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
Where Gradle version is lower that 4.1
None of the other solutions solved my problem. I ended up figuring out that the problem lied in the google services version. Just update it to the latest.
Top level gradle at dependencies:
classpath 'com.google.gms:google-services:4.1.0'
In my case, after the update of Android Studio and plugins, I could create new projects, but my old projects were having "Gradle Sync Issues".
The solution was in File/Project Structure.../App/Dependencies:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
And then I just updated the Kotlin version in my project build.gradle:
From:
ext.kotlin_version = '1.2.30'
To:
ext.kotlin_version = '1.3.21'
Then I tried Sync again.
Obs: You can check your Kotlin version in Tools/Kotlin/Configure Kotlin Plugin Updates
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"