RevenueCat / purchases-kmp

RevenueCat SDK for Kotlin Multiplatform
MIT License
72 stars 2 forks source link

Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Function 'UIKitViewController' can not be called: #201

Open mirzemehdi opened 3 days ago

mirzemehdi commented 3 days ago

Describe the bug

When using Paywall UI, in ios I get this error:


Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: 
Function 'UIKitViewController' can not be called: No function found for symbol 
'androidx.compose.ui.interop/UIKitViewController|UIKitViewController(kotlin.Function0<0:0>;
androidx.compose.ui.Modifier;kotlin.Function1<0:0,kotlin.Unit>?;
androidx.compose.ui.graphics.Color;kotlin.Function1<0:0,kotlin.Unit>?;kotlin.Function2<0:0,kotlinx.cinterop.CValue<platform.CoreGraphics.CGRect>,kotlin.Unit>?;kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<platform.UIKit.UIViewController>}[0]'

Any recommendation for quick fix?

Android works perfectly though

mirzemehdi commented 3 days ago

looks like because of compose version: https://github.com/RevenueCat/purchases-kmp/blob/cdf0e8dfeb1eb475e9e73b9a84f2faa0e91f5130/gradle/libs.versions.toml#L32

Bumping to latest compose version (1.7.0-beta01) should fix the issue I guess.

Similar issue: https://github.com/KevinnZou/compose-webview-multiplatform/issues/219

mirzemehdi commented 3 days ago

for anyone having this issue, quick fix is to downgrade compose version to 1.6.11

JayShortway commented 2 days ago

Thanks for reporting! And thanks for the suggested workaround. Which version of Compose does your project use? And which version of Kotlin? That might help pin this down to a specific combination of those 2.

mirzemehdi commented 2 days ago

@JayShortway kotlin version: 2.0.20 compose version: 1.7.0-beta01

JayShortway commented 1 day ago

Thanks! There seems to be a binary incompatibility between Compose 1.6.x and 1.7.0. As soon as 1.7.0 is stable, we should be able to support it and fix this issue.