02/18/2022, 6:51 AM
I created a KMM application using Android Studio, I am able to run the Android and iOS app. Then I created a macOS app that I want to make it depends on the Kotlin Module as well. I tried to copy the build phase from iOS to the macOS project but fail with this error
Copy code
Showing All Messages
> Task :mylibrary:embedAndSignAppleFrameworkForXcode FAILED

/Users/username/Library/Developer/Xcode/DerivedData/MyApp-macOS-bcjmruopehjfwogkwonshzamndam/Build/Products/Debug/ replacing existing signature

/Users/username/Library/Developer/Xcode/DerivedData/MyApp-macOS-bcjmruopehjfwogkwonshzamndam/Build/Products/Debug/ bundle format is ambiguous (could be app or framework)

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':mylibrary:embedAndSignAppleFrameworkForXcode'.

> Process 'command 'codesign'' finished with non-zero exit value 1
Is there anything extra that I should do to link the framework to the macOS app properly?

Rick Clephas

02/18/2022, 7:31 AM
Hi! There is an issue with the frameworks losing their symlinks, which results in a codesigning failure. This will be fixed in Kotlin 1.6.20-M1: I believe you can also disable the codesigning in Xcode as long as you are not on a M1 mac:


02/18/2022, 7:32 AM
Thanks for the info, unfortunately Im developing using M1 mac. Would you recommend a way for this kind of usecase ?

Rick Clephas

02/18/2022, 7:36 AM
Ah right well unfortunately there isn’t another workaround (that I know of). If you don’t mind updating to 1.6.20-M1 then there is actually no need for a workaround 🙂. Besides that you could try using CocoaPods instead of the embedAndSign task, but I also had some issues with CocoaPods and a macOS app on M1 (had to run it in Rosetta).


02/18/2022, 7:40 AM
ah i see. thanks so much. will try the 1.6.20-m1 probably.

Landry Norris

02/18/2022, 4:00 PM
You could also use and set up the xcode run script to use a swift package. I’ve started using this for a library I’m working on for work. I believe Swift Packages support macOS.