Kotlin-reflect extension funcions: OK with gradle, not with IntelliJ
Answered
I have a kotlin project that's using kotlin-reflect:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: '1.4.10'
}
Everything else is pretty boilerplate. The problem is that when I try to use parts of kotlin.reflect.full the whole system compiles just fine with 'gradle build' (in the terminal window of IntelliJ, or externally) but it always shows angry red letters in the editor:


I have tried invalidating the cache, wiping out ~/.m2/repository, made sure my Kotlin plugin was up-to-date, to no avail. One other thing I don't understand is it's still showing an older kotlin in the 'external libraries' list in the project view:

I really can't figure out where that's coming from, either. It's not in Module Dependencies under the SDK/target.
What else can I look at?
Please sign in to leave a comment.
Can you share a sample project where this could be reproduced?