I have the same issue. Tried everything mentioned above but its still there.
- Upgraded Intellij kotlin plugin to 1.2.51.
- Upgraded sdkman kotlin version to 1.2.51. (or deleted it then it reports kotlin home invalid)
- Tried wrapper version 4.7 or 4.8, but neither worked
it failed in both command line and intellij. What else can i try?
Update: I finally got it working after disabling sdkman (comment out its script in my bash profile) to remove the KOTLIN_HOME. After that, it picks up Intellij installed kotlin. So for me it is also a kotlin version conflicts between sdkman and intellij, though all are 1.2.51 they seem to be different version and incompatible.