I got “Unresolved Reference: Java”
error in following code.
val clazz = String::class.java
Loading kotlin-reflect library in build.gradle
resolved this error.
dependencies {
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// this line
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
...
}
Top comments (0)