Gradle Kotlin DSL: "cannot access java.lang.String" error

Ran into the same issue when updating from Kotlin 1.3.72 to 1.4.0, this is what worked for me:

  • Checkout the project again from version control, in a different location, and import it, this worked.
  • Re-open the existing project, this time the build.gradle.kts file loaded without any errors.

Also I tried a bunch of things from here, but none of it worked: jvm - Kotlin unresolved reference in IntelliJ - Stack Overflow