IntelliJ/Kotlin upgrade causing "Incompatible types" error?

Solution 1:

Quick History:

  • Originally installed IntelliJ 2018.3 to 2019.3 – no issues
  • Upgraded to IntelliJ 2020.3.2 – no issues
  • Updated to IntelliJ 2021.1 – error appeared

I ended up going back to IntelliJ 2020.3.3 to make the error stop

Docs clearly say:

"Install the IntelliJ IDEA Community Edition. Corda supports IntelliJ IDEA versions 2017.x, 2018.x, 2019.x, and 2020.x; and Kotlin plugin version 1.2.71."

…so when I updated to 2021.1 I was out of the recommended version. When 2020.3.2 prompted me to update I didn’t realize it was going to take me to 2021.1 (my fault).

Background: I am still really new to IntelliJ/Java but I tried everything I could think of the make the error go away and couldn’t fix it.

Kotlin Plugin:

  • 2021.1 wouldn’t let me install the Kotlin Plugin 1.2.71 because it’s not supported.
  • IntelliJ 2019.3 Kotlin Plugin 1.3.61-release-IJ2019.3-1 = no error
  • IntelliJ 2020.3 Kotlin Plugin 203-1.4.10-release-IJ7717.8 = no error
  • IntelliJ 2021.1 Kotlin Plugin 211-1.4.32-release-IJ6693.72 = error

I tried downgrading the Kotlin Plugin to an older version but it would always ignore the older plugin and stay with the new one.

I tried changing the Inspections but the error doesn’t seem to be coming from an inspection.

Changing the Kotlin compiler under Build, Execution, Deployment had no effect.