Prashant Jajal
Prashant Jajal

Reputation: 3627

Kotlin Not Configured : Android studio

Error which i am getting

I am able to run the project successfully. but unable to resolve this issue which is showing "kotlin Not Configured". I tried every solution for that but its always showing in the currently active file.

Please help.

Upvotes: 14

Views: 22777

Answers (8)

PsHye
PsHye

Reputation: 43

Happened to me randomly in one of my projects, and i just did Build Gradle and worked again

Upvotes: 0

Brolin Michael
Brolin Michael

Reputation: 31

I faced the same issue after updating to latest android electric eel. So those of you who had a kotlin project which working fine and after update failed to sync gradle files or build projects with error

"Kotlin not configured".

I think this answer might help. I'm not sure if this is the right way to do but this was a life saver for me since I was working with an old project with older dependencies and kotlin version

Just click on the gradle offline toggle and try syncing the project and building it in offline mode. That's it !!!

enter image description here

No need to change any version or other changes. I hope this helps and save your time.

Upvotes: 0

nitro_nitrat
nitro_nitrat

Reputation: 151

Simply hitting "Sync Project with Gradle Files" did the job for me. Screenshot of the button in Android Studio

Upvotes: 4

Sumit Patel
Sumit Patel

Reputation: 389

Click on Tools -> Kotlin -> Configure Kotlin in Project then choose the configurator, any one from:

  1. Java with Gradle
  2. Android with Gradle

Upvotes: 4

bhaskar
bhaskar

Reputation: 1080

Delete the .gradle and .idea file and restart the project. This seem to work for me.

Upvotes: 6

Le Trong Tan
Le Trong Tan

Reputation: 47

In my case, it can fix by keep the version of kotlin-gradle-plugin up to date. Check the version here: https://kotlinlang.org/docs/gradle.html#plugin-and-versions

File for configuration Location

Project -> build.gradle

//example: update this dependence:

dependencies {
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
}

Upvotes: 0

Cordis Audax Agrinova
Cordis Audax Agrinova

Reputation: 200

Furthermore, if you find a line implementation "androidx.core:core-ktx:+" in your build.gradle, you may see the warning message: Avoid using + in version numbers, can lead to unpredictable and anrepeatable builds. Click on "Replace with specific version", then the current installed version replaces the "+". (For example, "1.3.2") In my case the "kotlin not configured" message and a lot of "errors" in the kotlin file disappeared.

Upvotes: 2

Mostafa Sami
Mostafa Sami

Reputation: 21

try to upgrade the kotlin version in build.gradle file ext.kotlin_version = '1.3.72' also in the build.gradle app module file make sure implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" in the dependencies section , if you see at any time update the gradle option , do so

Upvotes: 2

Related Questions