I have a KMP shared module/lib being compiled to a...
# kotlin-native
r
I have a KMP shared module/lib being compiled to an Apple native "Framework", and I seem to have discovered that the framework's min OS version is being set higher than I'd like. I can't seem to find docs on how to customize the min OS version (specifically for macOS) in the shared lib's KMP Gradle config. Could anyone point me in the right direction for finding that?
s
r
Copy code
plugins {
     alias(libs.plugins.kotlinMultiplatform)
 }
 
 kotlin {
     listOf(
         macosArm64(),
         macosX64(),
         iosArm64(),
         iosX64(),
         iosSimulatorArm64(),
     ).forEach { appleTarget ->
         appleTarget.compilations.getByName("main") {
             val CoreMIDI by cinterops.creating {
                 definitionFile.set(project.file("src/appleMain/cinterop/CoreMIDI.def"))
             }
         }
         appleTarget.binaries.framework {
             baseName = "Shared"
             isStatic = true
         }
     }
 
     jvm()
 
     sourceSets {
         commonMain.dependencies {
             // put your Multiplatform dependencies here
             implementation(libs.kotlinx.coroutines.core)
         }
         commonTest.dependencies {
             implementation(libs.kotlin.test)
         }
     }
 }
s
kotlin { macosX64("macosX64") { binaries.framework { baseName = "Shared" binaryOption("macos_min_version", "10.13") } } }
i’m not sure if this’ll work but u can try
r
And when trying to run the iOS/macOS app on a Mac with OS version 14, I get this error:
Copy code
Could not launch “rk_midi_tools”
Domain: IDELaunchErrorDomain
Code: 20
Recovery Suggestion: The app requires a more recent version of macOS.
Please check the app's deployment target.
...
Copy code
"sdk_canonicalName" = "macosx15.2";
     "sdk_osVersion" = "15.2";
     "sdk_variant" = macos;
}
--


System Information

macOS Version 14.7.6 (Build 23H626)
Xcode 16.2 (23507) (Build 16C5032a)
Timestamp: 2025-06-22T22:19:47-04:00
s
did u try the code i mentioned?
r
Ah didn't see your 2nd message. I'll try shortly
When building the shared module it gives this warning multiple times:
Copy code
w: Unknown binary option 'macos_min_version'
And that happens even if I comment out the 3 iOS targets and leave only the 2 macOS targets
s
could you try macos_version_min?
r
Same error for
macos_version_min
. Do you know where any docs may be for what "binary option" keys are available?
s
i wasn’t able to find much docs
https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-native-distribution.html I found this docs. Look under LSMinimumSystemVersion. I dont think itll be applicable since yours is a library not an app