Thread
#multiplatform
    n

    Nicolas Verinaud

    2 months ago
    [SOLVED ] I have a strange bug when building the shared xcframework. Everything works fine on my Mac Intel but it fails on a M1 Mac with the error
    Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
    . Is there a cache or something on the M1 Mac ? It could be related to the kotlin version used but how can I verify ? Is this task unavailable on M1 Macs ?
    Alex Acosta

    Alex Acosta

    2 months ago
    M1 is supported, you have to also include
    iosSimulatorArm64()
    target in your build.gradle file.
    ...
    ios()
    iosSimulatorArm64()
    macosX64()
    ...
    Also, are you using SPM?
    n

    Nicolas Verinaud

    2 months ago
    Ok I did it, but now I have a load of
    could not resolve ...
    I’m not using SPM
    Alex Acosta

    Alex Acosta

    2 months ago
    try adding this as well:
    val iosMain by getting { ... }
    val iosSimulatorArm64Main by getting {
        dependsOn(iosMain)
    }
    val iosSimulatorArm64Test by getting {
        dependsOn(iosTest)
    }
    n

    Nicolas Verinaud

    2 months ago
    Even more
    could not resolve ...
    😅
    Maybe should I update some dependencies ?
    Alex Acosta

    Alex Acosta

    2 months ago
    some dependencies might not have the iosSimulatorArm64 support
    n

    Nicolas Verinaud

    2 months ago
    Okay, I updated
    benasher44:uuid
    and it disappeared from
    could not resolve
    issues
    Alex Acosta

    Alex Acosta

    2 months ago
    O do see the support, double check you are using the latest version:https://mvnrepository.com/artifact/com.benasher44/uuid-iossimulatorarm64
    n

    Nicolas Verinaud

    2 months ago
    Okay, I updated every dependencies, gradle sync works
    Building still fails with task not being found 😞
    Alex Acosta

    Alex Acosta

    2 months ago
    can you show the error logs?
    n

    Nicolas Verinaud

    2 months ago
    Oh I believe I found it
    Alex Acosta

    Alex Acosta

    2 months ago
    what was the problem?
    n

    Nicolas Verinaud

    2 months ago
    Yup that’s it, it works, problem was the configuration of the target
    Alex Acosta

    Alex Acosta

    2 months ago
    nice
    n

    Nicolas Verinaud

    2 months ago
    So, solution was adding the things I had in
    ios { ... }
    in the target
    iosSimulatorArm64 { ... }
    Alex Acosta

    Alex Acosta

    2 months ago
    makes sense
    n

    Nicolas Verinaud

    2 months ago
    ios {
            binaries {
                framework {
                    baseName = "shared"
                    transitiveExport = true
                    export("dev.icerock.moko:graphics:0.6.1")
                    export("dev.icerock.moko:resources:0.20.1")
                }
            }
        }
        iosSimulatorArm64() {
            binaries {
                framework {
                    baseName = "shared"
                    transitiveExport = true
                    export("dev.icerock.moko:graphics:0.6.1")
                    export("dev.icerock.moko:resources:0.20.1")
                }
            }
        }
    A bit of cleaning and we’re good to go. Thanks @Alex Acosta !