Search code examples
iosswiftxcodeframeworkscode-signing

Fastlane Codesign Failing w/ Shared Framework


I'm working on a multiple target project with an additional shared Framework target that contains a few SPM dependencies in itself. Each app target has it's own bundle identifier, and the framework has it's own identifier.

I am using Fastlane to run CI for the project and, among other things, am running both match and gym to pull in my code signing profiles and build the application.

The issue I'm having is no matter what I do, the codesign step for the only the framework fails with the error errSecInternalComponent. I've adjusted the signing to be automatic, and even had match generate development certificates for my ad-hoc builds in an attempt to have them be picked up by the signing process for the framework.

The above is when the framework is marked as Embed & Sign. When changing it to Embed Without Signing, I get an error indicating No signing certificate "iOS Development" found.

As far as I'm aware, frameworks shouldn't require provisioning profiles or app identifiers to be created in the developer console, yet the errors I'm seeing seem to indicate they do.

Has someone encountered something similar to this? How do I go about getting the app to compile properly when running in a CI context, or at the very least, properly code sign the framework?

Thanks in advance for all the help.


Solution

  • To anyone who has a similar issue in the future, I was able to resolve this by turning off automatic code signing on the framework target and setting the signing from iOS Developer to iOS Distribution.

    Since I am using Fastlane and Match, I am unable to use automatic code signing. This is fine for the app targets themselves, but it was causing issues with the framework target. Even though the framework didn't need to be signed, it was still required to be set to automatic code signing or to have a code signing profile selected.

    In the CI/CD pipelines, I am only building the application for ad-hoc distribution using the distribution certificate and ad-hoc profile, so Fastlane is not pulling in a developer profile for the manual signing on the framework to find.

    As soon as I updated the framework to use the iOS Distribution profile, the target was able to find the ad-hoc certificate and profile pulled in by Match and use those to satisfy it's requirements.