Skip to content

Including cryptography-kotlin changes the minos and sdk of the KMP iOS framework to 14.0 #103

@lyamamot

Description

@lyamamot

Before including this library as a dependency, the minos and sdk of my project's KMP iOS framework were 13.0 and 18.0, respectively. After including this library, they are both set to 14.0.

This caused an error while submitting the app to the App Store because the XCFramework container for the framework was declaring compatibility back to iOS 13.0 but the included framework was set to a minimum of 14.0. This can be worked around by setting the MinimumOSVersion in the XCFramework in the KMP shared library's build.gradle.kts:

kotlin {
    listOf(
        iosArm64(),
        iosSimulatorArm64(),
    ).forEach {
        it.binaries.framework {
            // Set minimum iOS version of shared library for compatibility with dependencies, such as cryptography-kotlin.
            freeCompilerArgs +=
                listOf(
                    "-Xoverride-konan-properties=osVersionMin.ios_simulator_arm64=$minimumIosVersion;osVersionMin.ios_arm64=$minimumIosVersion;osVersionMin.ios_x64=$minimumIosVersion",
                )

However, I'm wondering about two things:

  1. Now that sdk is set to 14.0, is the framework being built with the iOS 14 SDK instead of iOS 18 and/or will this cause problems in the future if I need to bump my minimum version above 14.0?
  2. Should this requirement to have a minimum version of 14.0 be documented?

I've created a small reproducer project here: https://github.com/lyamamot/cryptography-dependency-changes-minos-reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingswiftAnything related to swiftinterop

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions