MohamedRejeb / Calf

Calf is a library that allows you to easily create adaptive UIs and access platform specific APIs with Compose Multiplatform (Adaptive UI, File Picker, WebView, Permissions...).
https://mohamedrejeb.github.io/Calf/
Apache License 2.0
950 stars 42 forks source link

AdaptiveDatePicker crashes on iOS when the user clicks on a day. The error message is “dateSelection]: unrecognized selector sent to instance.” #189

Closed WPSeven closed 1 day ago

WPSeven commented 2 weeks ago

calf-ui = "0.5.5" kotlin = "2.0.10" compose= "1.6.11" iOS = 18.1/17.5

When I click on the day on the calendar AdaptiveDatePicker it crashes on iOS. I’m not sure what to look for, but it works perfectly on Android.

I’ve come across some logs that show “NSInvalidArgumentException,” and I’m not too familiar with iOS. Could you please suggest someone who might be able to help me out?

Screenshot 2024-10-30 at 4 46 30 PM Screenshot 2024-10-30 at 4 44 08 PM
MohamedRejeb commented 1 week ago

Hi thanks for opening this issue, I think that the problem is with your gradle configuration. Do you have this line here? https://github.com/MohamedRejeb/Calf/blob/acb2a7388a776a6f22fcf7f351868359c3113695/sample/common/build.gradle.kts#L16

WPSeven commented 1 day ago
 listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "ComposeApp"
            isStatic = true

            // IMPORTANT: Exporting calf-ui is required for some functionalities to work
            export(libs.mohamedrejeb.calf.ui)
        }
    }

Now it is working, thanks.