Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchMethodError after updating to 1.4.3-native-mt #2565

Closed
whyoleg opened this issue Mar 5, 2021 · 2 comments
Closed

java.lang.NoSuchMethodError after updating to 1.4.3-native-mt #2565

whyoleg opened this issue Mar 5, 2021 · 2 comments
Labels

Comments

@whyoleg
Copy link
Contributor

whyoleg commented Mar 5, 2021

After updating coroutines version from 1.4.2 to 1.4.3 (native-mt, not sure if it's matter) i have such errors on trying to run tests on K/JVM (IR):

'java.lang.Object kotlinx.coroutines.TimeoutKt.withTimeout-lwyi7ZQ(double, kotlin.jvm.functions.Function2, kotlin.coroutines.Continuation)'
java.lang.NoSuchMethodError: 'java.lang.Object kotlinx.coroutines.TimeoutKt.withTimeout-lwyi7ZQ(double, kotlin.jvm.functions.Function2, kotlin.coroutines.Continuation)'
	at app.cash.turbine.ChannelBasedFlowTurbine.withTimeout(FlowTurbine.kt:207)
	at app.cash.turbine.ChannelBasedFlowTurbine.expectEvent(FlowTurbine.kt:239)
	at app.cash.turbine.ChannelBasedFlowTurbine.expectItem(FlowTurbine.kt:245)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1$1.invokeSuspend(RSocketTest.kt:97)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1$1.invoke(RSocketTest.kt)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1$1.invoke(RSocketTest.kt)
	at app.cash.turbine.FlowTurbineKt$test$2.invokeSuspend(FlowTurbine.kt:88)
	at app.cash.turbine.FlowTurbineKt$test$2.invoke(FlowTurbine.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
	at app.cash.turbine.FlowTurbineKt.test-9vOVOX0(FlowTurbine.kt:57)
	at app.cash.turbine.FlowTurbineKt.test-9vOVOX0$default(FlowTurbine.kt:54)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1.invokeSuspend(RSocketTest.kt:95)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1.invoke(RSocketTest.kt)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1.invoke(RSocketTest.kt)
	at io.rsocket.kotlin.test.SuspendTest$test$1$result$1$1.invokeSuspend(SuspendTest.kt:50)
	at io.rsocket.kotlin.test.SuspendTest$test$1$result$1$1.invoke(SuspendTest.kt)
	at io.rsocket.kotlin.test.SuspendTest$test$1$result$1$1.invoke(SuspendTest.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(Undispatched.kt:102)
	at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:148)
	at kotlinx.coroutines.TimeoutKt.withTimeout(Timeout.kt:44)
	at kotlinx.coroutines.TimeoutKt.withTimeout-KLykuaI(Timeout.kt:72)
	at io.rsocket.kotlin.test.SuspendTest$test$1.invokeSuspend(SuspendTest.kt:50)
	(Coroutine boundary)
	at io.rsocket.kotlin.core.RSocketTest$testStream$1.invokeSuspend(RSocketTest.kt:95)
	at io.rsocket.kotlin.test.SuspendTest$test$1$result$1$1.invokeSuspend(SuspendTest.kt:50)
	at io.rsocket.kotlin.test.SuspendTest$test$1.invokeSuspend(SuspendTest.kt:50)

https://github.com/rsocket/rsocket-kotlin/runs/2025389394?check_suite_focus=true
on K/JS and K/Native it works well. on 1.4.2 everything works well.
project has dependencies on coroutines as well as ktor (which depends on coroutines 1.4.2-native-mt) and turbine.

Is the issue caused by changes in inline classes mangling scheme?
in 1.4.3 after upgrade to kotlin 1.4.30, coroutines uses new mangling schema from kotlin 1.4.30, while ktor uses old

Another possible cause of the issue is changed publication of MPP artifacts in 1.4.20

Is there workaround on consumer side possible?

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented Mar 5, 2021

Is the issue caused by changes in inline classes mangling scheme?

Indeed. The Kotlin version update (1.4.0 -> 1.4.30) affects users of experimental inline-classes.
So, 1.4.3 is basically incompatible with anything that relies on 1.4.2 and uses experimental inline-classes API.

But in that case, you had to get an experimentality warning: library authors shouldn't provide stable API that internally depends on experimental inline classes or other experimental API. If you didn't get the warning, I suggest filing an issue in the corresponding projecs.

@xenomachina
Copy link

This also affects (at least) kotlinx-coroutines-core-jvm, so perhaps the title of this issue should be made more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants