Thread
#multiplatform
    Lukasz Kalnik

    Lukasz Kalnik

    9 months ago
    When I change the shared module, what Gradle task can I use to rebuild the shared Framework for XCode to notice the changes?
    Stefan Oltmann

    Stefan Oltmann

    9 months ago
    assembleSharedReleaseXCFramework
    Lukasz Kalnik

    Lukasz Kalnik

    9 months ago
    Hmm, task not found...
    Build tasks
    -----------
    assemble - Assemble main outputs for all the variants.
    assembleAndroidTest - Assembles all the Test applications.
    build - Assembles and tests this project.
    buildDependents - Assembles and tests this project and all projects that depend on it.
    buildKotlinToolingMetadata - Build metadata json file containing information about the used Kotlin tooling
    buildNeeded - Assembles and tests this project and all projects it depends on.
    clean - Deletes the build directory.
    compileDebugAndroidTestSources
    compileDebugSources
    compileDebugUnitTestSources
    compileKotlinIos - Compiles a klibrary from the 'main' compilation for target 'native'.
    compileReleaseSources
    compileReleaseUnitTestSources
    compileTestKotlinIos - Compiles a klibrary from the 'test' compilation for target 'native'.
    extractDebugAnnotations - Extracts Android annotations for the debug variant into the archive file
    extractReleaseAnnotations - Extracts Android annotations for the release variant into the archive file
    iosMainKlibrary - Assembles outputs for compilation 'main' of target 'ios'
    iosTestKlibrary - Assembles outputs for compilation 'test' of target 'ios'
    linkDebugFrameworkIos - Links a framework 'debugFramework' for a target 'ios'.
    linkDebugTestIos - Links a test executable 'debugTest' for a target 'ios'.
    linkReleaseFrameworkIos - Links a framework 'releaseFramework' for a target 'ios'.
    metadataJar - Assembles an archive containing the main classes.
    metadataMainClasses - Assembles outputs for compilation 'main' of target 'metadata'
    Currently I just click the "Run iosApp" button. The app obviously fails, but the framework is built and then I can make relevant changes in XCode. But there should be a "cleaner" way.
    Stefan Oltmann

    Stefan Oltmann

    9 months ago
    Do you have a XCFramework configured? This is my config:
    val xcf = XCFramework()
    
    /* App Store */
    iosArm64 {
        binaries.framework {
            baseName = "shared"
            embedBitcode("bitcode")
            xcf.add(this)
        }
    }
    
    /* Intel iOS Simulator */
    iosX64 {
        binaries.framework {
            baseName = "shared"
            xcf.add(this)
        }
    }
    That should add an
    assemble*Shared*ReleaseXCFramework
    if your framework also is named "shared".
    Lukasz Kalnik

    Lukasz Kalnik

    9 months ago
    Ah ok
    I have the default setup generated by the KMM plugin
    iosTarget("ios") {
            binaries {
                framework {
                    baseName = "shared"
                }
            }
        }
    I will add the xcf setup, thanks!