https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Stefan Oltmann

03/16/2022, 5:07 PM
I want to build only a release XCFramework, but not both. Gradle generates me a
assembleXCFramework
task. I see in the docs that there should be also
assembleDebugXCFramework
and
assembleReleaseXCFramework
tasks, but I don't see them... How can I only build the release version? I don't need debug.
1
t

Thomas Kranzer

03/16/2022, 5:54 PM
for me this works by using
assemble[Projectname]ReleaseXCFramework
. However, this command is not listed within the available gradle tasks, there i only see
assemble[Projectname]XCFramework
but not the build type specific ones.
s

Stefan Oltmann

03/17/2022, 8:28 AM
Yes, it's strange - maybe docs are outdated. I only have
assembleXCFramework - Assemble all types of registered 'shared' XCFramework
But I remember in the past there were tasks that had "shared" in the name. Now I get
Task 'assembleSharedReleaseXCFramework' not found in root project.
Ok, now these are there, but they still build and link debug frameworks. What I needed to do was this:
Copy code
iosArm64 {
    binaries.framework(
        buildTypes = setOf(NativeBuildType.RELEASE)
    ) {
        baseName = "shared"
        embedBitcode("bitcode")
        xcf.add(this)
    }
}
34 Views