We are producing an iOS XCFramework for our SDK which uses a KMP library provided as a SPM.
The code works correctly on Android, but on iOS if we consume the XCFramework, then the first code that does any Kotlin allocations seems to fail with EXC_BAD_ACCESS.
However this is only happening when consuming the XCFramework (which is built Debug), as running the code from the workspace works correctly.
As you can see from the screenshot, it is failing in a kotlin.mm.AllocateArray call.
Does anyone know how building the code into an XCFramework would cause the Kotlin allocations to fail?
We are not embedding the KMP library, so it's being added as a dependency in the project using the SDK XCFramework,
Is there some KMP library we need to add to the XCFramework?