JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.21k stars 1.17k forks source link

iOS pod implementation throws selector error #3836

Closed LaatonWalaBhoot closed 1 year ago

LaatonWalaBhoot commented 1 year ago

Describe the bug GoogleSignIn ios pod fails with selector implementation

Affected platforms Select one of the platforms below:

Versions

To Reproduce ` @OptIn(ExperimentalForeignApi::class) @Composable actual fun OnboardingView( modifier: Modifier ) {

val controller = UIApplication.sharedApplication.keyWindow?.rootViewController

Box(Modifier.fillMaxSize()) {
    UIKitView(
        modifier = Modifier.fillMaxSize(),
        factory = {
            UIView()
        },
        update = {
            val config = GIDConfiguration(clientID = BuildKonfig.GOOGLE_WEB_CLIENT_ID)
            controller?.let {
                GIDSignIn.sharedInstance().setConfiguration(config)
                GIDSignIn.sharedInstance.signInWithPresentingViewController(controller) { result, error ->

                }
            }
        }
    )
}

} `

Expected behavior ViewController should handle the delegated sign-in flow

Additional context Android implementation is working correctly. iOS implementation consistently throws 'NSInvalidArgumentException', reason: '-[GIDSignIn setConfiguration:]: unrecognized selector sent to instance 0x600000d0a6a0'

MatkovIvan commented 1 year ago

Please check if you included GoogleSignIn correctly into your project. unrecognized selector sent usually means that a library is missing and the application cannot load it at runtime.

This problem does not seem related to Compose, closing

LaatonWalaBhoot commented 1 year ago

@MatkovIvan Apologies. This is my gradle spec with GoogleSignIn. I have run pod install and all the rest of the pods are working correctly

` @OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) kotlin { targetHierarchy.default() jvmToolchain(11) android() ios() iosSimulatorArm64()

cocoapods {
    summary = "Some description for the Shared Module"
    homepage = "Link to the Shared Module homepage"
    version = "1.0"
    ios.deploymentTarget = "14.1"
    podfile = project.file("../iosApp/Podfile")
    framework {
        baseName = "shared"
        isStatic = true
    }

    pod("Amplitude", "8.17.1")
    pod("FirebaseMessaging")
    pod("FirebaseAuth")
    pod("Reachability")
    pod("GoogleSignIn")
    pod("lottie-ios") {
        version = "4.3.3"
        moduleName = "Lottie"
    }
}

`

MatkovIvan commented 1 year ago

Could you please provide more details on why you believe the issue is related to Compose but not GoogleSignIn?

LaatonWalaBhoot commented 1 year ago

when used as a swift package dependency in native code GoogleSignIn works absolutely fine. But kotlin cocoa pods seem to be having this issue Have double-checked my imports. Like you said the lib seems like its missing method signature perhaps because of interop issue

terrakok commented 1 year ago

Since is is not the Compose issue, could you file a new issue in Kotlin Cocoapods tracker (with a small reproducer)?

LaatonWalaBhoot commented 1 year ago

Sure. Thanks

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.