Kotlin Multiplatform Library - Info.plist invalid MinimumOSVersion

123 Views Asked by At

Given a Kotlin Multiplatform library project with an android and iOS target, the generated XCFramework does have an invalid Info.plist-File.

The iOS Application can't be uploaded for review because the value for the MinimumOSVersion is set to 12. My iOS-Application on the other hand does have a TargetSDK-Version of 15. Is there a way to change the value of the MinimumOSVersion inside the Info.plist of the created XC-Framework?

I am using the latest stable Android Studio Release and Kotlin 1.9.10 and gradle 8.0.

1

There are 1 best solutions below

0
On

The Frameworks/shared.framework/Info.plist that contains the problematic MinimumOSVersion is generated by Konan. To double-check that it is indeed wrong, you can run vtool -show Frameworks/shared.framework/shared to see the discrepancy.

Normally you'd change the MinimumOSVersion in this generated Info.plist by adding:

freeCompilerArgs += listOf("-Xoverride-konan-properties=minVersion.ios=15.0")

to your binaries { framework {...} } in build.gradle.kts (see https://youtrack.jetbrains.com/issue/KT-56676).

The problem is that in Kotlin 1.9.10 combined with Xcode > 15.0, the minVersion.ios is ignored, and you need to set minVersionSinceXcode15.ios instead (which was introduced in https://youtrack.jetbrains.com/issue/KT-60758).

As a solution, update your build.gradle.kts to:

freeCompilerArgs += listOf("-Xoverride-konan-properties=minVersion.ios=15.0;minVersionSinceXcode15.ios=15.0")

and rebuild, and you should pass the validation. Kotlin 1.9.20 seems not to have the minVersionSinceXcode15 any more, so I guess you'll be fine with just minVersion.ios again, but I haven't upgraded / double-checked myself yet.