Kotlin Native library exported to .framework crashes on Xcode

I’m trying to implement a library using Kotlin Multiplatform to use in my iOS project so I download the official library template, which implements a Fibonacci sequence.

I did only 2 changes in this project:

  1. I changed the Kotlin version from 1.9.0 to 1.9.21
  2. In the file library/build.gradle.kts I updated the target iosSimulatorArm64() to output a .framework so I could use it on my Xcode iOS project, like this:
    iosSimulatorArm64() {
        binaries {
            framework {
                baseName = "TestLibrary"

Then I ran the command ./gradlew iosSimulatorArm64Binaries and the TestLibrary.framework was properly generated for me.

However, after I include this .framework in my project, my apps crashes right away as soon as try to run the app (the Xcode project builds without any problem; it only crashes when I actually try to run the app), throwing this error:

I not even tried to run the Fibonacci code in the iOS project yet; the app crashes by simply adding the framework and trying to run the app. Any idea what is happening here?

Does the original project generated by Android Studio work?

Yes, the JVM/Android target works.

I managed to find a workaround for my problem exporting to .xcframework instead of just .framework.