[SOLVED :white_check_mark:] I have a strange bug w...
# multiplatform
n
[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 ?
plus1 2
a
M1 is supported, you have to also include
iosSimulatorArm64()
target in your build.gradle file.
Copy code
...
ios()
iosSimulatorArm64()
macosX64()
...
Also, are you using SPM?
n
Ok I did it, but now I have a load of
could not resolve ...
I’m not using SPM
a
try adding this as well:
Copy code
val iosMain by getting { ... }
val iosSimulatorArm64Main by getting {
    dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
    dependsOn(iosTest)
}
n
Even more
could not resolve ...
😅
Maybe should I update some dependencies ?
a
some dependencies might not have the iosSimulatorArm64 support
n
Okay, I updated
benasher44:uuid
and it disappeared from
could not resolve
issues
a
O do see the support, double check you are using the latest version: https://mvnrepository.com/artifact/com.benasher44/uuid-iossimulatorarm64
n
Okay, I updated every dependencies, gradle sync works
Building still fails with task not being found 😞
a
can you show the error logs?
n
Oh I believe I found it
a
what was the problem?
n
Yup that’s it, it works, problem was the configuration of the target
a
nice
n
So, solution was adding the things I had in
ios { ... }
in the target
iosSimulatorArm64 { ... }
a
makes sense
n
Copy code
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 !
3