https://kotlinlang.org logo
a

Arkadii Ivanov

02/08/2022, 11:26 AM
I'm unable to build an Xcode project on macOS M1. The error is:
Task 'embedAndSignAppleFrameworkForXcode' not found in project 'sampletodo-darwin-umbrella'.
I already checked KT-49637 and KT-47077 which look similar to my problem, but nothing was helpful. I'm using Kotlin 1.6.10 and I have
iosSimulatorArm64
target configured. I have the following Java version installed locally:
15.0.6 (arm64) "Azul Systems, Inc." - "Zulu 15.38.17"
Also I noticed that there are Gradle tasks
linkDebugFrameworkIosArm64
and
linkDebugFrameworkIosX64
, but there is no Gradle task like
linkDebugFrameworkIosSimulatorArm64
, only
linkDebugTestIosSimulatorArm64
which seems irrelevant. Running the Xcode in Rosetta mode fixes the build, but I would like avoid Rosetta if possible. Are there any ideas of how I could fix the issue?
a

Artyom Degtyarev [JB]

02/08/2022, 12:12 PM
Hello! The fact that
linkDebugFrameworkIosSimulatorArm64
is missing might mean that, while having this target declared, your project is still missing the framework declaration. Could you please check if its present there too?
a

Arkadii Ivanov

02/08/2022, 12:27 PM
Thanks for pointing that out! I have the framework declared under
ios {}
, perhaps that is the issue and I should also explicitly declare it for
iosSimulatorArm64
. I will try and post updates here soon.
👍 1
a

Artyom Degtyarev [JB]

02/08/2022, 12:28 PM
Yes, that should be it. Target shortcuts do not include Apple Silicon simulators(link).
a

Arkadii Ivanov

02/08/2022, 3:30 PM
Thanks again, that fixed the issue.
j

John O'Reilly

02/08/2022, 3:35 PM
the "Task 'embedAndSignAppleFrameworkForXcode' not found" issue seems to come up quite frequently....would it make sense to have something on say one of the official Kotlin/JetBrains pages with some info on possible causes etc?
☝️ 2
I could be wrong but I think there's been occurrences caused by different issues to the one in this thread.
a

Artyom Degtyarev [JB]

02/08/2022, 3:38 PM
From what I can see, the amount of feedback mentioning this output is quite small. However, maybe it really worth something like a FAQ post. cc @akapanina
j

John O'Reilly

02/08/2022, 3:40 PM
if you search for example for "'embedAndSignAppleFrameworkForXcode' not found" in kotlinlang there's quite a few results
☝️ 1
@Rick Clephas I think you had come across issue as well with this related to something like framework name setting I think?
r

Rick Clephas

02/08/2022, 3:51 PM
Yeah correct so far I known of 3 possible causes: 1. a missing target (e.g.
iosSimulatorArm64
) 2. not configuring the framework (which was the case for @Arkadii Ivanov). I was faced with that after trying to migrate from CocoaPods to the embedAndSign task 3. trying to run the embedAndSign task outside the Xcode environment (which isn’t supported) A lot of the confusion seems to be around the
ios
shortcut and the “missing”
iosSimulatorArm64
target. But there should be a solution “in the works” 🙂: https://kotlinlang.slack.com/archives/C3PQML5NU/p1641129596025400?thread_ts=1640966595.016600&cid=C3PQML5NU I personally just stopped using the shortcuts btw.
k

Konstantin Tskhovrebov

02/08/2022, 5:45 PM
Main problem is any misconfiguration of project doesn't register the embed... task. It was my mistake to do this way. In 1.6.20 it should be better because the embed... task is registered anytime (if there are ios targets)
👍 2
👍🏻 1
62 Views