How to go back to a previous version of the IntelliJ Kotlin plugin?

I’ve just updated the IntelliJ Kotlin plugin to 1.2.60, but now I get the following error:

Error:Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin org.jetbrains.kotlin.kapt3.Kapt3ComponentRegistrar is not compatible with this version of compiler
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:198)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:117)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:446)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:295)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:147)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:94)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:50)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:88)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:402)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:929)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:101)
	at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:969)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:928)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:400)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.AbstractMethodError
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:190)
	... 33 more

This error occurs whether I update the Kotlin stuff in build.gradle to 1.2.60 too or stay with 1.2.51.

So, I want to go back to the previous version of the Kotlin plugin to be able to work on my project. How can I do that?

1 Like

It seems like IntelliJ had changed the JVM target version to 1.6. I reset it to 1.8 and now I’m able to compile.

However, it would be good to know how to go back to a previous version of the Kotlin plugin in case of a plugin error.

You can download a previous version of the plugin for your IDE here https://plugins.jetbrains.com/plugin/6954-kotlin and then use the “Install plugin from disk” action.

1 Like

Thank you!

Alternatively when switching between release streams uninstall the plugin (normally reverting back to the version bundled with the IDE) and then update again with the correct stream.

1 Like

The same error occurred again after the recent minor update. This is pretty annoying! The bad thing is that I can not simple reset the target JVM version in this case. The update process of the Kotlin plugin seems to be very fragile.

This time I helped myself with the following:

  • uninstall the Kotlin plug-in 1.2.60 (so that 1.2.51 delivered with IntelliJ is effective again)
  • revert to Kotlin 1.2.51 in build.gradle
  • remove all IntellIj related stuff from project directory (.idea/, *.iml)
  • restart IntelliJ
  • re-import project

As I’ve already said: This is ANNOYING! I suggest that JetBrains should keep the compiler interface more stable.

I’m getting the same error. For me I was able to fix it by downgrading Kotlin version from 1.2.60 to 1.2.51, even using the wrong plugin version in Intellij.

This doesn’t work for me unfortunately, it asks me to restart the ide to apply changes, when I do the newer version of the plugin shows up as installed :frowning:

I’m trying to install the older version of the plugin from the disc, but when I restart the IDEA and check the version of the plugin, it is newer version instead. Please help.

It’s even worse for me. Android Studio now hangs on startup :frowning:

Ok uninstalling doesn’t help. I guess I’ll go try find the right folders to delete. I DO NOT recommend this approach.

If this crashes android studio like it did for me, here is the folder to delete on Mac:
~/Library/Application Support/Google/AndroidStudioX.X

If I had a suggestion, I’d say to implement a feature in both GUI & CLI to revert plugin versions. I had to detour from work for a few hours earlier this week due to the recent Kotlin upgrades.

I have to stick to 1.4.32 for now since I use JetPack Compose and they’ve merged, but haven’t yet released, support for 1.5.0. I upgraded my project and the IDE plugin and then found out it wasn’t compatible. So I downgraded it in my project, but couldn’t downgrade it in the IDE.

No big deal at first, but then started hitting OOM errors due to the string interpolation bug in 1.5.0. It took me quite a while before I was able to pin down the cause (which shortly afterwards popped up in the forums as reported by other users).

Once I isolated it to the Kotlin plugin, I tried to disable it, but that of course killed my Android Studio install. Then I looked for a CLI method to try to disable that plugin, but no dice. Then I hunted for the 1.4.32 plugin archive, found it, downloaded it, swapped it in the install directory, and then had to play around the text file to disable/enable plugins in the Android Studio install directory.

I was able to restore my install & verify that both my project & the IDE were both using the 1.4.32 plugin. Got back to work, great!

I’m getting notifications about 1.5.20 being available. I’d like to upgrade as soon as the next version of Compose is released, but I’m honestly apprehensive about it now due to the aforementioned issue.

I like the product (and the other products by JetBrains), not trying complain. It’s just strange that a legitimate scenario for downgrades doesn’t seem to have been considered (but maybe I’m wrong).

Anyway, my $0.02. Sorry for rambling, hope it was constructive.

5 Likes

I have a similar issue, but this time caused by inconsistence with kotlin serialization like described here: https://youtrack.jetbrains.com/issue/KT-42126

Since I started to use Kotlin, seems like every time I upgrade an existing project to a new gradle kotlin plugin version, I have some new and weird kind of random issue, taking from me hours to figure out what is happening!

As example, I really dont’t understand why the IDE recommend and allow a no-warning instalation of a plugin version marked as “not compatible” in the repository…

Got this is still happening after all these years.

You finally give in to those persistent pop-ups and then upgrade Kotlin plugin and then you are stuck in a limbo. Sad thing is you can’t even go back to an older version because when you try to install it from the disk it says incompatible with this installation (even after removing it first).

I finally upgraded from 1.3.61 to 1.5.10 and everything broke. I can’t even get the setup back as it was.

It literally is just a mess!