Hello everybody, Is it possible to customize the n...
# multiplatform
h
Hello everybody, Is it possible to customize the name of the xcframework? The shared module is called "shared," and when compiling the XC framework, it retains the same name. Is it possible to customize it with other name?
👀 1
p
I tried with
no success
, commenting here to get notified.
b
It’s baseName I think. We’re changing our XCFramework name at botstacks this way (albeit cocoapods) https://github.com/BotStacks/mobile-sdk/blob/main/chat-sdk/build.gradle.kts
👍 1
p
My experience was with the default kmp Gradle task to generate the xcframework. Maybe cocoapods have the magic 🪄
g
This is what I do in my prod KMP app. No Cocoapods required:
Copy code
kotlin {
    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64(),
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "SharedKotlin" // This is the line that changes the name
            isStatic = true
        }
    }
}
If you are using the non-Cocoapods method of integrating KMP into iOS, don’t forget to update: • imports in Swift • The
Other linker options
field in Xcode (I think the flags are case-insensitive, but every example I’ve ever seen matches the case you use in
baseName
but makes the first letter lowercase. I use
sharedKotlin
for example
👍 2