Code signing "Capacitor.framework" failed when attempting to Distribute App to App Store

Ok, I’m still a little new to ios development/apple ecosystem, so apologies if i’m making any obvious mistakes here.

I have a VueJS/Capacitor app that I’ve built which seems to be running great for Android and for ios simulator/device. I have successfully built the archive that I’d like to distribute to App Store, but I appear to have an issue with code signing for capacitor framework, that I’ve spent hours trying to resolve.

I have tried embedding capacitor.framework, using custom script to remove unused frameworks in build phase and probably several other approaches that I’ve already forgotten :sweat_smile:

Perhaps I just need a little (extra) guidance on proper way to embed and sign this framework…?

Here’s what I’m working with:
Mac Sonoma 14.2.1
Node v21.5.0
Pod 1.15.0
Gem 3.5.4
Ionic 7.2.0
Capacitor 5.5.1
Xcode 15.2

I sure appreciate it everyone!

*EDIT - forgot to include relevant<?> log

2024-02-07 01:16:56 +0000  Running /usr/bin/codesign '-vvv' '--force' '--sign' '0AA963C864B95300FAD488B0E059C50ADC34A899' '--entitlements' '/var/folders/rd/wjxdcx1x2874061l6ftl7lgh0000gn/T/XcodeDistPipeline.~~~VlRxvh/entitlements~~~okpA6h' '--generate-entitlement-der' '--strip-disallowed-xattrs' '--preserve-metadata=identifier,flags,runtime' '/var/folders/rd/wjxdcx1x2874061l6ftl7lgh0000gn/T/XcodeDistPipeline.~~~VlRxvh/Root/Payload/'
2024-02-07 01:16:56 +0000  /var/folders/rd/wjxdcx1x2874061l6ftl7lgh0000gn/T/XcodeDistPipeline.~~~VlRxvh/Root/Payload/ replacing existing signature
2024-02-07 01:16:56 +0000  /var/folders/rd/wjxdcx1x2874061l6ftl7lgh0000gn/T/XcodeDistPipeline.~~~VlRxvh/Root/Payload/ errSecInternalComponent
2024-02-07 01:16:56 +0000  /usr/bin/codesign exited with 1
2024-02-07 01:16:56 +0000  Step "<IDEDistributionCodesignStep: 0x600000f199c0>" failed for distribution item "Capacitor.framework" with error "Error Domain=IDEDistributionPipelineErrorDomain Code=0 "Code signing "Capacitor.framework" failed." UserInfo={NSLocalizedDescription=Code signing "Capacitor.framework" failed., NSLocalizedRecoverySuggestion=View distribution logs for more information.}"

Thank you for the reference! Unfortunately, none of those resolve this issue for me :confused:

I hadn’t encountered that guide, but most of those steps I’ve been finding and attempting while trying to debug all the issues that seem to pop up when doing an iOS build.

Maybe you can try and removing the ios platform and re adding it. Make sure to follow the steps in the docs. Getting Started | Capacitor Documentation