ios – Kotlin Multiplatform 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 app crashes as soon as try to run the it (the Xcode project builds without any problem; it only crashes when I actually try to run the app), throwing this error:

Xcode crash

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?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img