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
903 stars 41 forks source link

ImagePicker iOS compile issue #180

Open vladmircan opened 2 weeks ago

vladmircan commented 2 weeks ago

Hello and thank you for the effort put into this library! Perhaps it's an issue on my end but after integrating calf-imagePicker into my shared module, iOS compilation fails with the following exception:

java.lang.IllegalStateException: FIELD name:com_mohamedrejeb_calf_picker_FilePickerFileType_Image$stable type:kotlin.Int visibility:public [final,static]

On Android everything works well. And on iOS it compiles if I don't specify FilePickerFileType or FilePickerSelectionMode. So relying on default arguments works for some reason.

Any ideas as to what might be causing this? Thanks!

MohamedRejeb commented 6 days ago

Hi, Thanks for reporting this issue. What's Calf version that you are using? Also what are your Kotlin & Compose versions?

vladmircan commented 4 days ago

Hello, thanks for coming back to me on this. My versions are the following:

I hope this information helps. Otherwise I will spend some time and create a minimum reproducible example.

MohamedRejeb commented 4 days ago

That's an issue with Compose Compiler in Kotlin 2.0.0, updating Kotlin to 2.0.10 or higher will fix it.

You can check the versions table here: https://mohamedrejeb.github.io/Calf/installation/

https://github.com/MohamedRejeb/Calf/issues/137

vladmircan commented 2 days ago

Hello again, happy to report that upgrading to Kotlin 2.0.10 fixed the issue. Thanks so much for your help, I don't even want to know how long it would have taken me to find it on my own.

Feel free to close this issue as resolved.