2

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)
...
sigma1510
  • 1,165
  • 1
  • 11
  • 26
  • 1
    Have you tried cleaning and rebuilding the project? What else have you tried? Is the version of Kotlin also 1.7.10? Where is it set? Have you set platform dependencies on the Kotlin and Kotlinx Serialization BOMs? Can you share more of your `build.gradle.kts`? Please update your question to include this info. – aSemy Jul 18 '22 at 11:17

1 Answers1

5

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
sigma1510
  • 1,165
  • 1
  • 11
  • 26