Fixing iOS code-signing errors in Kotlin Multiplatform projects
Last updated: July 27, 2026
When building the iOS application in a Kotlin Multiplatform project, Codemagic may report errors such as:
Failed to set code signing settings for iosApp.xcodeprojor:
Did not find matching provisioning profiles for code signingThese errors usually mean that Codemagic cannot match the bundle identifier of an Xcode target with an installed provisioning profile, or that the signing settings are not correctly configured in the Xcode project.
1. Verify the bundle identifier
Confirm that the iOS target uses the same bundle identifier as the provisioning profile configured in Codemagic.
Depending on the Kotlin Multiplatform template, the bundle identifier may be defined in one or more of the following locations:
iosApp/Configuration/Config.xcconfigiosApp/iosApp.xcodeproj/project.pbxprojOr in the target’s Signing & Capabilities settings in Xcode.
Newer Kotlin Multiplatform templates may define it in Config.xcconfig using a variable such as:
BUNDLE_ID=com.example.myappThe Xcode target must resolve its PRODUCT_BUNDLE_IDENTIFIER to the same value.
You can inspect the resolved bundle identifiers during a Codemagic build with:
xcodebuild \
-project iosApp/iosApp.xcodeproj \
-scheme iosApp \
-showBuildSettings |
grep PRODUCT_BUNDLE_IDENTIFIERUse -workspace instead of -project if the application is built from an Xcode workspace.
2. Check the Info.plist configuration
The application’s Info.plist should normally resolve the bundle identifier from the Xcode build settings:
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>Avoid hard-coding a different bundle identifier in Info.plist, as this can cause it to differ from the value configured for the Xcode target.
If the project uses Xcode’s generated Info.plist feature, this entry may not appear in a physical file. In that case, inspect the target’s resolved build settings rather than adding another Info.plist unnecessarily.
3. Verify that the configuration file is assigned
If the project defines values in Config.xcconfig, confirm that the file is assigned to the build configurations used by the iOS target.
In Xcode:
Open the iOS project or workspace.
Select the project in the Project Navigator.
Open the Info tab.
Under Configurations, confirm that the appropriate
.xcconfigfile is assigned to the required Debug, Release, and Profile configurations.
Also inspect the .xcconfig file for values such as:
BUNDLE_ID=com.example.myapp
TEAM_ID=ABCDE12345
APP_NAME=MyAppThe exact variable names depend on the project template. A custom TEAM_ID variable only affects signing if the Xcode project maps it to the DEVELOPMENT_TEAM build setting.
To inspect the resolved team setting, run:
xcodebuild \
-project iosApp/iosApp.xcodeproj \
-scheme iosApp \
-showBuildSettings |
grep DEVELOPMENT_TEAM4. Verify every signed target
Kotlin Multiplatform projects may contain more than one signed Xcode target, including:
the main iOS application;
notification service extensions;
widgets;
share extensions;
watch applications.
Each target has its own bundle identifier and may require its own matching provisioning profile.
Run the following command to inspect all detected identifiers:
xcode-project detect-bundle-idIf multiple identifiers are returned, make sure that signing files are available for each target.
5. Configure signing in Codemagic
When fetching signing files automatically, configure the application bundle identifier under ios_signing:
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: com.example.myappFor projects with multiple targets, reference the required provisioning profiles explicitly or ensure that matching profiles are available for all bundle identifiers.
Before building the IPA, apply the installed profiles to the Xcode project:
scripts:
- name: Configure iOS code signing
script: |
cd "$CM_BUILD_DIR/iosApp"
xcode-project use-profilesThe command output should show which provisioning profile is assigned to each target and build configuration.
6. Use the correct project or workspace flag
Use --workspace only when building an .xcworkspace:
- name: Build IPA
script: |
cd "$CM_BUILD_DIR/iosApp"
xcode-project build-ipa \
--workspace "iosApp.xcworkspace" \
--scheme "iosApp"Use --project when the project only contains an .xcodeproj:
- name: Build IPA
script: |
cd "$CM_BUILD_DIR/iosApp"
xcode-project build-ipa \
--project "iosApp.xcodeproj" \
--scheme "iosApp"If CocoaPods is used, run pod install first and build the generated workspace rather than the project file.
For example:
- name: Install CocoaPods dependencies
script: |
cd "$CM_BUILD_DIR/iosApp"
pod install
- name: Configure iOS code signing
script: |
cd "$CM_BUILD_DIR/iosApp"
xcode-project use-profiles
- name: Build IPA
script: |
cd "$CM_BUILD_DIR/iosApp"
xcode-project build-ipa \
--workspace "iosApp.xcworkspace" \
--scheme "iosApp"7. Check the provisioning profile
Confirm that:
The profile uses the exact bundle identifier of the target;
The profile’s distribution type matches the workflow;
The profile belongs to the same Apple Developer team as the signing certificate;
The certificate referenced by the profile is installed;
And the profile has not expired.
You can list the installed signing files during the build with:
security find-identity -v -p codesigningand:
find "$HOME/Library/MobileDevice/Provisioning Profiles" \
"$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles" \
-name "*.mobileprovision" \
-print 2>/dev/nullTroubleshooting checklist
If Codemagic still cannot find a matching profile, verify the following:
PRODUCT_BUNDLE_IDENTIFIERresolves to the expected value;The provisioning profile contains that exact identifier;
All application extensions have matching profiles;
the expected
.xcconfigfile is assigned to the Release configuration;DEVELOPMENT_TEAMresolves to the correct Apple team;xcode-project use-profilesruns before the IPA build;And the build command uses the correct
--projector--workspaceoption.
Also, review the output from xcode-project use-profiles. It normally identifies the target or bundle identifier for which no matching profile was found.