Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin 1.3 with Gradle - "Kotlin not configured" error after marking the source root in intellij

I started from a regular non-Gradle Kotlin project. Then I decided later on to link my project to Gradle. I have set up my build.gradle.kts as mentioned in the Kotlin docs:

plugins {
    kotlin("jvm") version "1.3.72"
}

repositories {
    mavenCentral()
}

dependencies {
    implementation(kotlin("stdlib"))
}

The build was successful. However, Intellij could no longer recognize my Kotlin modules (no syntax highlighting, etc.). Even the option of creating new Kotlin files was no longer available. So I thought maybe I just needed to mark the src directory as the Source Root, but the error "Kotlin not configured" appeared at the top.

Is there something wrong with my build? I'm still new to Gradle. I've tried other solutions like invalidating the cache and changing the dependencies but none of them seemed to work.

like image 516
Melvic Ybanez Avatar asked Apr 19 '20 16:04

Melvic Ybanez


1 Answers

I closed my project, and then I ran:

rm -rf .idea .gradle gradle

and then it worked again

like image 83
Julia Avatar answered Sep 19 '22 13:09

Julia