I have a Java spring boot project where I am mixing kotlin. Though I am stuck with this runtime exception. Which I do not understand why it happens and how to solve this
Caused by: java.lang.NoSuchMethodError: 'void kotlin.jvm.internal.FunctionReferenceImpl.<init>(int, java.lang.Class, java.lang.String, java.lang.String, int)'
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.<init>(SafeCollector.kt) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.<clinit>(SafeCollector.kt) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at kotlinx.coroutines.flow.internal.SafeCollectorKt.<clinit>(SafeCollector.kt:15) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:87) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:66) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at com.apollographql.apollo3.network.http.HttpNetworkTransport$execute$1.invokeSuspend(HttpNetworkTransport.kt:83) ~[apollo-runtime-jvm-3.7.4.jar:3.7.4]
at com.apollographql.apollo3.network.http.HttpNetworkTransport$execute$1.invoke(HttpNetworkTransport.kt) ~[apollo-runtime-jvm-3.7.4.jar:3.7.4]
at com.apollographql.apollo3.network.http.HttpNetworkTransport$execute$1.invoke(HttpNetworkTransport.kt) ~[apollo-runtime-jvm-3.7.4.jar:3.7.4]
at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
Happens for the following code
val response = runBlocking {
apolloClient.mutation(
UpdateCuratedCollectionMutation(
input = curatedCollectionInput,
version = collection.updatedAt.toEpochSecond()
)
).execute()
}
My dependencies are following
springBootVersion = '2.7.4'
id "org.jetbrains.kotlin.jvm" version "1.8.10"
id "com.apollographql.apollo3" version "3.7.4"
id 'org.jetbrains.kotlin.plugin.lombok' version '1.8.10'
id 'io.freefair.lombok' version '5.3.0'
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10'
implementation "com.apollographql.apollo3:apollo-runtime:3.7.4"