Home > Software engineering >  Gradle fails after kotlin serialization plugin update to 1.7.10
Gradle fails after kotlin serialization plugin update to 1.7.10

Time:07-22

My build.gradle.kts starts as follows:

...
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
  ...
  
  kotlin("jvm") //target version is java 11
  kotlin("plugin.serialization") version "1.6.21"
}

When I try to update the kotlin serialization plugin to the more recent 1.7.10 version, I get the following compilation error:

A problem occurred configuring project ':my-little-project'.
> Failed to notify project evaluation listener.
   > org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin: org.jetbrains.kotlinx.serialization.gradle.SerializationGradleSubplugin not a subtype
   > org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin: org.jetbrains.kotlinx.serialization.gradle.SerializationGradleSubplugin not a subtype

How do I fix this? Thanks!

Stack trace (too large to post completely, for more just ask):

Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':my-little-project'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:51)
...
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:89)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
...

CodePudding user response:

Thanks @aSemy for listing what turned out to be the issue. Our microservice architecture meant there was another, overarching, build.gradle.kts file which contained this line that also needed updating:

kotlin("jvm") version "1.6.10" apply false
  • Related