jvm – Kotlin unresolved reference in IntelliJ
jvm – Kotlin unresolved reference in IntelliJ
Your Intellij IDEA plugin and the Kotlin runtime/compiler that you use in the project need to match. For example if IDE plugin is Beta 1, but your Gradle/Maven project using M12, youll have issues exactly as you described. So check that everything lines up.
If you still have issues, with some older plugins you need to clear the caches in Intellij IDEA (file menu, Clear Caches and Restart, select option to restart).
UPDATE – 01/2022
The jetbrains thread regarding this issue has moved and is nowhere to be found, so the link below is not valid anymore.
The option, per module, Kotlin -> FIX
does not exist anymore and has been that way for years now since this was a temporary patch to deal with integration issues during the early previous releases.
If anyone stumbles across this and NEITHER Invalidate Cache
or Update Kotlins Version
work:
- First, make sure you can build it from outside the IDE. If youre using
gradle
, for instance:gradle clean build
If everything goes well , then your environment is all good to work with Kotlin
.
- To fix the IDE build, try the following:
Project Structure -> {Select Module} -> Kotlin -> FIX
As suggested by a JetBrains member here: https://discuss.kotlinlang.org/t/intellij-kotlin-project-screw-up/597
jvm – Kotlin unresolved reference in IntelliJ
In my case, it was a misconfigured IntelliJ instance.
Project Structure -> SDKs -> Remove and add the Java SDK again
Related posts on jvm :
- jvm – Find the java.exe location from java
- java – what are custom jvm properties?
- java – How to set JVM arguments in IntelliJ IDEA?
- java – Oracle SQL Developer: Unable to find a JVM
- windows – jvm.dll missing error when launching application
- java – What does -Xmn jvm option stands for
- java – How to have 2 JVMs talk to one another
- Intellij Invalid Gradle JVM Configuration